Bug 394545 - katepart find/replace does not recognize \n in some contexts
Summary: katepart find/replace does not recognize \n in some contexts
Status: RESOLVED DUPLICATE of bug 381080
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 17.12.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-22 05:40 UTC by Shriramana Sharma
Modified: 2018-08-15 09:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shriramana Sharma 2018-05-22 05:40:43 UTC
I am using Kate/KWrite on a fresh install of Kubuntu Bionic.
 
I was trying to manually convert a plaintext file to HTML so tried to replace '\n' (without quotes of course) to '<br />\n' but I found that <br /> isn't added to empty lines or lines with pure whitespace (line below ddf in following example has a space) and the last line:

BEFORE FIND/REPLACE:

sadfasdf
asdfas

asdfl
asdfflsdflasd
ddf
 

adflkasf
asflkaflkasf

AFTER FIND/REPLACE:

sadfasdf<br />
asdfas

asdfl<br />
asdfflsdflasd<br />
ddf<br />
 

adflkasf<br />
asflkaflkasf
Comment 1 Shriramana Sharma 2018-05-22 06:02:53 UTC
Sorry for the multiple posts but on closer examination I find the behaviour is much more curious. For an input file such as below (ignore the dashed lines):

---

a
b
---

... having a newline before the 'a', after the 'b' and between them, only the one between them is recognized.

But go to the line after 'b', type one letter and immediately backspace and try the find/replace again, presto the newline after 'b' is recognized, but only once. Try that again and it is no longer recognized!

Likewise go to the line before 'a', type one letter and immediately backspace and try the find/replace again, presto the newline before 'a' is recognized.

This is very strange to say the least…

I should also note that the same behaviour is seen in KDevelop as well presumably because it uses the same Katepart.
Comment 2 Dominik Haumann 2018-08-15 09:13:16 UTC
This is fixed for KDE Frameworks 5.50, see bug #381080.

*** This bug has been marked as a duplicate of bug 381080 ***