Bug 411472 - kdiff3 cannot insert a blank line in 3way merge
Summary: kdiff3 cannot insert a blank line in 3way merge
Status: RESOLVED FIXED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (show other bugs)
Version: 1.8.x
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: michael
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-31 14:32 UTC by bugmenot.oss
Modified: 2020-03-27 15:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.8.2


Attachments
The problem (107.97 KB, image/png)
2019-08-31 14:32 UTC, bugmenot.oss
Details
attachment-25839-0.html (67 bytes, text/html)
2019-08-31 14:41 UTC, michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugmenot.oss 2019-08-31 14:32:42 UTC
Created attachment 122435 [details]
The problem

When 3-way merging from a git repo, you could still pretty much merge the same way but it becomes a bit tedious to use the text editor in the output pane.

When pressing enter to insert a blank line somewhere in an unindented line in the text editor, it will become a <Merge Conflict> and is impossible to "solve" or get overwritten as shown in the attached image.

The <Merge Conflict> from this problem will not prevent saving the merge.
Also, the <Merge Conflict> from this problem will not be saved as a new lines.

STEPS TO REPRODUCE
1. Initiate a 3-way merge on some merges with unresolved conflicts.
2. Resolve all conflicts.
3. Find a non indented line go to the end of that line.
4. Try inserting a new and blank line by pressing enter
5. Try writing anything on that new line.

OBSERVED RESULT
A new line marked with <Merge Conflict> is shown which is both unwrtitable and unerasable.

EXPECTED RESULT
A new and blank line is shown which is marked with "m" on the left side of the output pane.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.16.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
I think this may be reproducible for 2-way merges on regular files initiated from kdiff3 itself, so doing it from git may not be really needed.

There is a possible work-around. Try pressing enter in between some text. That is, the cursor should have at least a single character in front and in back of the text cursor. Doing so, it should be possible to insert a new line then use sed to clean the lines afterwards. Removing the contents from kdiff3's text editor will still result to the same state as mentioned before, <Merge Conflict>.
Comment 1 michael 2019-08-31 14:41:58 UTC
Created attachment 122437 [details]
attachment-25839-0.html

This indeed does happen on two ways as well.
Comment 2 michael 2020-03-27 15:03:52 UTC
Git commit 426aa87f7fd15c4fabed446469035a651265b285 by Michael Reeves.
Committed on 27/03/2020 at 14:34.
Pushed by mreeves into branch 'master'.

Fix adding blank line.

Don't treat newly intserted lines as  a conflict.
FIXED-IN:1.8.2

M  +9    -2    src/MergeEditLine.h

https://invent.kde.org/kde/kdiff3/commit/426aa87f7fd15c4fabed446469035a651265b285
Comment 3 michael 2020-03-27 15:04:56 UTC
Git commit 60e142bd99e0db0b2d5a6f2ba7732f2432d85fdc by Michael Reeves.
Committed on 27/03/2020 at 05:01.
Pushed by mreeves into branch '1.8'.

Fix adding a blank line.

Don't treat newly intserted lines as  a conflict.
FIXED-IN:1.8.2

M  +9    -7    src/mergeresultwindow.h

https://invent.kde.org/kde/kdiff3/commit/60e142bd99e0db0b2d5a6f2ba7732f2432d85fdc