Community
    • Login

    Diff attributes new line to the wrong line.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 237 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.
    • Derek WhiteD
      Derek White
      last edited by

      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?

      mkupperM 1 Reply Last reply Reply Quote 0
      • mkupperM
        mkupper @Derek White
        last edited by

        @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.

        Alan KilbornA 1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @mkupper
          last edited by Alan Kilborn

          @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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors