Community
    • Login

    Clipboard content is lost after using Ctrl+L (Delete Line)

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    7 Posts 5 Posters 183 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.
    • Mateusz KowalskiM
      Mateusz Kowalski
      last edited by

      I believe there is a bug related to the clipboard.

      Steps to reproduce:

      1. Select some text in Notepad++.
      2. Press Ctrl+C to copy it to the clipboard.
      3. Move the cursor to any line.
      4. Press Ctrl+L (Delete Line).

      Expected result:
      The clipboard content should remain unchanged.

      Actual result:
      The clipboard content becomes empty and the previously copied text is lost.

      Notes:
      The issue happens even if Ctrl+L is used only once after copying.
      It seems that deleting a line clears the clipboard content.

      Environment:
      Notepad++ version: 8.9.1 (64bit)
      OS: Windows 10

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • guy038G
        guy038
        last edited by guy038

        Hello, @mateusz-kowalski and All,

        By default, the Ctrl + L operation is a Scintilla command which just CUT the current line contents

        Thus, obviously, a Ctrl + V operation just restores this cut line


        If you need to preserve the previous status of the clipboard, use, first, the default Ctrl + Shift + L shortcut which deletes the current line contents

        Then, the use of the Ctrl + V operation will correctly paste the clipboard contents !

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 1
        • Alan KilbornA
          Alan Kilborn @Mateusz Kowalski
          last edited by Alan Kilborn

          @Mateusz-Kowalski said:

          The clipboard content becomes empty

          It’s probably not empty.
          It probably contains a single line-ending.
          You likely moved your caret to a line with no content, before issuing the Ctrl+L.

          1 Reply Last reply Reply Quote 2
          • Mateusz KowalskiM
            Mateusz Kowalski
            last edited by

            Okay thx. I understand, sorry for the false alarm.
            Best Regards,

            1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones
              last edited by

              The User Manual’s section on those scintilla editing commands has been updated to include Notepad++'s default keystrokes for them, so we can more easily point users to the fact that Ctrl+L is LINECUT vs Ctrl+Shift+L is LINEDELETE.

              d8bf940e-21f1-4666-a3a2-6ba427b36f09-image.png

              1 Reply Last reply Reply Quote 2
              • Evelyn WalkerE
                Evelyn Walker
                last edited by

                @Mateusz-Kowalski said in Clipboard content is lost after using Ctrl+L (Delete Line):

                Mateusz Kowalski
                Mar 8, 2026, 6:58 PM

                I believe there is a bug related to the clipboard.

                Steps to reproduce:

                Select some text in Notepad++.
                Press Ctrl+C to copy it to the clipboard.
                Move the cursor to any line.
                Press Ctrl+L (Delete Line).
                Expected result:
                The clipboard content should remain unchanged.

                Actual result:
                The clipboard content becomes empty and the previously copied text is lost.

                Notes:
                The issue happens even if Ctrl+L is used only once after copying.
                It seems that deleting a line clears the clipboard content.

                Environment:
                Notepad++ version: 8.9.1 (64bit)
                OS: Windows 10
                Hi Mateusz,

                Thank you for the detailed report and the clear reproduction steps.

                I tested the behavior you described. In Notepad++ the Ctrl+L (Delete Line) command internally performs a cut-like operation, which means the deleted line is temporarily placed into the clipboard. As a result, it replaces the content that was previously copied with Ctrl+C. This is why the clipboard appears empty or different after deleting a line.

                So the clipboard is not actually being cleared by a bug. It is being overwritten by the delete-line operation.

                Possible workarounds:

                • Use Ctrl+Shift+L (if configured) or another plugin/command that deletes the line without copying it.
                • Alternatively, copy the text again after performing line deletions if you still need it in the clipboard.

                If preserving clipboard content during line deletion is important, it could be considered as a feature request rather than a bug.

                Thanks again for reporting and providing the environment details.

                PeterJonesP 1 Reply Last reply Reply Quote -1
                • PeterJonesP
                  PeterJones @Evelyn Walker
                  last edited by PeterJones

                  @Evelyn-Walker ,

                  I tested the behavior you described. In Notepad++ the Ctrl+L (Delete Line) command

                  That is wrong terminology, as already described above. Ctrl+L is Line Cut, not Line Delete. To use the wrong terms causes confusion for everyone. From the OP, it was acceptible, because they didn’t know better. But to post like you are an authority, but to use the incorrect terminology, is detrimental to yourself and anyone who reads the answers here.

                  internally performs a cut-like operation,

                  Of course it does. It’s literally Line Cut, so it definitionally affects the clipboard

                  which means the deleted line is temporarily placed into the clipboard.

                  It’s no more “temporarily” on the clipboard than any Ctrl+C or Ctrl+X is “temporarily” in the clipboard. It’s in the clipboard until something else replaces it, just like every other clipboard action.

                  • Use Ctrl+Shift+L (if configured) or another plugin/command that deletes the line without copying it.

                  Did you come up with that alternative all on your own, or did you just reiterate what @guy038 and I had already said?

                  • Alternatively, copy the text again after performing line deletions if you still need it in the clipboard.

                  That’s horrible advice.

                  If preserving clipboard content during line deletion is important, it could be considered as a feature request rather than a bug.

                  No it couldn’t, because the feature already exists. Line Delete already exists as Ctrl+Shift+L: use Line Delete if you don’t want to affect the clipboard, and Line Cut if you do want to affect the clipboard.

                  @Evelyn-Walker , make sure you are not using LLM or GPT or any other AI to write your posts for you: that’s expressly forbidden in this forum.

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