• Login
Community
  • Login

Add dummy lines that does not increase the line numbers

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
line positionnumberingsynchronizedscrolling
2 Posts 2 Posters 419 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.
  • ?
    A Former User
    last edited by Jan 8, 2022, 4:56 PM

    I have two documents side by side, and the second document is a translation of the first. But the second document does not have every line translated. I want to keep the two documents in sync with vertical scrolling, so every translation is next to the string it has translated. But I also need each translated line to keep its original line number.

    I have a copy of the translated document, so adding additional lines does no harm. But these additional lines can’t add to the line number. It doesn’t matter if other software read these as real lines, as long as Notepad++ does not read them as real lines.

    P 1 Reply Last reply Jan 8, 2022, 5:45 PM Reply Quote 0
    • P
      PeterJones @A Former User
      last edited by Jan 8, 2022, 5:45 PM

      @liggliluff

      Notepad++'s line numbering system just counts the lines in order. You cannot trick it as you described.

      The Compare Plugin will line things up side-by-side, and it will appear to add more lines while viewed in Compare mode… but as soon as you turn off the compare mode, the original file goes back to the original line number (and when it’s saved to disk, even if you are in Compare mode, it will save the real file, not the one with extra lines).

      Alternately, you could start with the original file, and use the column mode selection and Edit > Column Editor dialog to insert line numbers in the text, which will match up with the original line numbers in the document. Then, if you had to insert lines to get things to line up correctly, you will easily see the empty lines as compared to the lines that start with the number. When done, you can delete the blank lines (Edit > Line Operations > Remove Empty Lines ), then use column-selection or a regex to remove the numbers at the beginning of each of the lines.

      1 Reply Last reply Reply Quote 1
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors