Community
    • Login

    Space and text highlighted automatically after pressing backspace or similar key.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 5 Posters 2.2k 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.
    • W
      will-spenser
      last edited by

      Sometimes after pressing enter or backspace a small amount of empty space around the cursor will then be automatically highlighted, such that my next input will overwrite that space including whatever might have previously been in it. want to disable this for obvious reasons.

      Terry RT 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R @will-spenser
        last edited by

        @will-spenser

        You will need to provide far more information than that before anyone can begin to make an informed guess.

        How about reading the FAQ post Request for Help without sufficient information to help you here.

        Things such as installed version, whether you have plugins working, the type of file you are working on (since it may involve a lexer causing the highlighting).

        After you provide some of the information there may be more questions.

        One thing you can try is to run Notepad++ without plugins, read this FAQ post on how to test that.

        Terry

        mkupperM 1 Reply Last reply Reply Quote 3
        • mkupperM
          mkupper @Terry R
          last edited by

          This topic thread made me realized I had not paid that much attention to the backspace key.

          I discovered a couple of things:

          1. There are no default Notepad++ shortcut mappings that mention backspace.
          2. The Notepad++ manual mentions the word “backspace” once and it’s on https://npp-user-manual.org/docs/searching/ as “\b ⇒ The BS control character 0x08 (backspace). This is only allowed inside a character class definition. Otherwise, this means ‘a word boundary’.”

          In playing with the backspace key I see that:

          • Backspace deletes either the selected area(s) or a single character to the left of the cursor.
          • Ctrl-Backspace deletes words or parts of words to the left of he cursor.
          • Ctrl-Shift-Backspace deletes the entire line to the left of the cursor. If there are selection(s) then those plus the entire line(s) to the left of the selection(s) are deleted.
          • Alt-Backspace seems to be “undo” or the same as Ctrl-Z.
          • Alt-Shift-Backspace seems to do nothing which is a surprise as I would have expected behavior much like re-do or Ctrl-Y.
          • Shift-Backspace seems to behave like a normal backspace.
          • Ctrl-Alt-Backspace seems to do nothing.
          • Ctrl-Alt-Shift-Backspace seems to do nothing.

          The behavior is the same for both the left and right hand sets of the Alt, Ctrl, and Shift keys. I did not test any of the combinations of using a left key with a right key. Windows tells applications which keys are held down and has different keycodes for the left and right ones meaning an application could assign a function to a specific pattern of keys…

          None of the tests left any text selected. Thus, @will-spenser’s reported behavior is not expected. @Terry-R’s advice will be useful to better understand if the reported behavior can be replicated.

          PeterJonesP 1 Reply Last reply Reply Quote 1
          • PeterJonesP
            PeterJones @mkupper
            last edited by PeterJones

            @mkupper said in Space and text highlighted automatically after pressing backspace or similar key.:

            There are no default Notepad++ shortcut mappings that mention backspace.

            684ce10e-48d4-498c-be56-37db82dc65b5-image.png

            … but you are right, it doesn’t show the other Ctrl- or Alt-modified versions of the backspace commands.

            mkupperM 1 Reply Last reply Reply Quote 1
            • mkupperM
              mkupper @PeterJones
              last edited by

              Thank you @PeterJones - I learned a couple of things about the shortcut mapper.

              1. The filter box matches both the Name or Shortcut column for all tabs except the one Scintilla where it only matches the Name column.
              2. The Shortcut sub dialog for the Scintilla tab is special in that it allows you to view/edit/define multiple shortcuts for the same function. I was puzzled the other day in that this dialog box did not support multiple shortcuts for a Menu menu function that I wanted to have two shortcut for but had not noticed that you can do this for Scintilla actions.
              3. Related to my previous post is that SCI_UNDO is defined as both Ctrl-Z and Alt-Backspace and SCI-REDO is defined as both Ctrl-Y and Ctrl-Shift-Z. I had not seen those in my previous post as I was using “back” in the filter box and did not know then that the filter does not look at the Shortcut column when on the Scintilla tab.

              I’m now wondering if 1 and 2 are “by design” or something that got overlooked and can be fixed. Github has:

              • Issue 13941 about Shift-backspace
              • Issue 10486 and also issue 12557 about that the filter box does not work as expected in the Scintilla tab. There are no comments about either reported issue.

              I did not see anything on github about that the user interface supports multiple shortcuts to Scintilla functions but not for the other classes of functions. A while back I had tried multiple shortcut definitions to a non-Scintilla function in my shortcuts.xml but discovered only the last shortcut of those defined for a function was recognized. I never explored the source code enough to understand what was happening.

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

                @mkupper said in Space and text highlighted automatically after pressing backspace or similar key.:

                1. The filter box matches both the Name or Shortcut column for all tabs except the one Scintilla where it only matches the Name column.

                I have often known this (as evidenced by #10486 … and then promptly forget it before the next time it comes up.

                Right now, the Manual only claims that filter works on Name, not on Shortcut. I should probably add that the filter “also works on Shortcut, except on the Scintilla tab”.

                1. The Shortcut sub dialog for the Scintilla tab is special in that it allows you to view/edit/define multiple shortcuts for the same function

                The manual does have a paragraph on that uniqueness of the Shortcut Mapper’s Scintilla tab.

                I’m now wondering if 1 and 2 are “by design” or something that got overlooked and can be fixed.

                The reason for point 1 is probably actually point 2: because Scintilla commands allow multiple shortcuts, filtering on those shortcuts might not be able to work the same, so it was just not implemented. (But not knowing the code, I cannot say that for sure.)

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

                  I wonder what the rationale was for allowing multiple shortcuts for the same Scintilla command, but only one shortcut for non-Scintilla commands?

                  Perhaps because “Copy” (and related) command is (or used to be) very common in apps as Ctrl+Insert as well as Ctrl+c?

                  I wonder how hard it would be to allow ALL commands to have multiple shortcuts. (The current workaround is to define a macro for a single command, and then assign the macro a keycombo).

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