• Login
Community
  • Login

Diff attributes new line to the wrong line.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 3 Posters 238 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    Derek White
    last edited by Jul 11, 2024, 3:54 AM

    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?

    M 1 Reply Last reply Jul 11, 2024, 7:06 AM Reply Quote 0
    • M
      mkupper @Derek White
      last edited by Jul 11, 2024, 7:06 AM

      @Derek-White, try inserting a new line using Ctrl+Alt+Shift+Enter or Edit / 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 the Edit / 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.

      A 1 Reply Last reply Jul 11, 2024, 11:05 AM Reply Quote 0
      • A
        Alan Kilborn @mkupper
        last edited by Alan Kilborn Jul 11, 2024, 11:48 AM Jul 11, 2024, 11:05 AM

        @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
        1 Reply Last reply Reply Quote 2
        1 out of 3
        • First post
          1/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors