Community
    • Login

    CR line terminators are pasting as CRLF

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 4 Posters 4.1k 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.
    • Jason BolstadJ
      Jason Bolstad
      last edited by

      This might be a bug, but if I create a text file in Notepad++, then do a replace of all the CRLF line terminators with CR I end up with a file that looks like
      Line 1<CR>
      Line 2<CR>
      Line 3<CR>

      If I then copy this text and paste it back into the same document I get
      Line 1<CR><LF>
      Line 2<CR><LF>
      Line 3<CR><LF>

      The text in the clipboard seems to be just the <CR>, so why when I paste it back do I get <CR><LF>?

      Thanks

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Jason Bolstad
        last edited by

        @Jason-Bolstad

        There’s something in the Paste mechanism that examines the line-ending setting for the current file–see the status bar area where it says “Windows (CR LF)” or “Unix (LF)”–and converts anything that looks like a line-ending to THAT format at the time of the pasting.

        1 Reply Last reply Reply Quote 1
        • gstaviG
          gstavi
          last edited by

          As far as I am concerned this is the desired behavior.
          Line ending style is a property of a file. A file should never have mixed different line endings.
          Copying text (code segments) between files with different endings is common and the fact that Notepad++ converts the line endings according to the destination file style is good.

          1 Reply Last reply Reply Quote 2
          • dailD
            dail
            last edited by

            I do agree this is usually the desired behavior. I often copy/paste from various sources and would hate to have all the line endings mixed up.

            That said, there is a way to turn it off. You’d need to install a plugin such as LuaScript or PythonScript so that you can call SCI_SETPASTECONVERTENDINGS and set it tofalse.

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