linuxmint / xed

X-Apps [Text] Editor (Cross-DE, backward-compatible, GTK3, traditional UI)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate line duplicates 2 lines when used at end of line

PQCraft opened this issue · comments

 * Xed version - 3.6.0
 * Distribution - Arch

Issue
Pressing Ctrl+Shift+D to duplicate a line works as intended when the cursor is before a char in the line but duplicates the next line too if used at the end.

Steps to reproduce
Cursor before char in line:

 L i n|e   1
 L i n e   2

after ctrl+shift+d

 L i n|e   1
 L i n e   1
 L i n e   2

------
Cursor at end of line:

 L i n e   1|
 L i n e   2

ctrl+shift+d

 L i n e   1|
 L i n e   2
 L i n e   1
 L i n e   2

Expected behaviour
Only the current line should be duplicated.

 L i n e   1|
 L i n e   2

ctrl+shift+d

 L i n e   1|
 L i n e   1
 L i n e   2

Other information
Minor gripe but I think it should also be a single undo to get rid of the duplicated line. Currently, you have to press ctrl+z twice:

 L i n|e   1
 L i n e   2

ctrl+shift+d

 L i n|e   1
 L i n e   1
 L i n e   2

ctrl+z

 L i n e   1
|
 L i n e   2

ctrl+z

 L i n e   1|
 L i n e   2