Diff attributes new line to the wrong line.
-
When I insert a new line into a doc, the new line and the line above it show as modified.
This is not intuitive to me. Seems as though the new line (\n) and the new line’s text are treated as being before the existing new line (\n), which just rubs me the wrong way. If I add a single line, I expect a single line to be modified.
Can I change this?
-
@Derek-White, try inserting a new line using
Ctrl+Alt+Shift+Enter
orEdit / Line / Insert Blank Line Below Current
in the menus. That will insert the new line below the line that the cursor is on and positions the cursor at the start of the line. I suspect the resulting behavior will be closer to what you consider to be intuitive.If you are satisfied with the result you get from
Ctrl+Alt+Shift+Enter
then you could assign a less cumbersome keyboard shortcut to theEdit / Line / Insert Blank Line Below Current
function.I did an experiment where I positioned the text cursor or caret in the middle of line of text and pressed
Enter
which split the line. Notepad++ marked the first part of the line as “modified” but not the latter part of the line that is now below the first part. I would have expected both lines to be flagged as “modified.” I’ll need to think about Notepad++'s result and why the author of Notepad+++ did not mark both lines as modified. -
@mkupper said:
I’ll need to think about Notepad++'s result and why the author of Notepad+++ did not mark both lines as modified.
You’ll probably want to think about why the authors of Scintilla did what they did, instead.
IMO this (the whole topic) may not be worth a lot of pondering.
I positioned the text cursor or caret in the middle of line of text and pressed Enter which split the line. Notepad++ marked the first part of the line as “modified” but not the latter part of the line that is now below the first part.
One (of probably several) rationalizations for this:
- the original line is marked modified as something (line-ending) was inserted into it
- the inserted line is “entirely new” and hasn’t been modified yet