Community
    • Login

    SurroundSelection sometimes hijacks shortcut Ctrl+Shift+2

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 315 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.
    • Neil SchipperN
      Neil Schipper
      last edited by

      I’m pasting in the issue I submitted over at dail’s SurroundSelection project.

      I (and maybe also dail) would like to know if other people are seeing the same behavior.

      ====

      When SurrSel is enabled, and text is selected, shortcut Ctrl+Shift+2 results in a SurrSel-like action where the text is surrounded by a pair of NUL:

      image

      … rather than the default action of jumping to the previous instance of text with “Style 2”.

      Problem goes away when SurrSel is disabled.

      If no text is selected, the shortcut does the expecting jumping.

      Notepad++ v8.4.9   (64-bit)
      Build time : Jan 27 2023 - 03:11:16
      Path : C:\Users\Guest!\Downloads\npp.8.4.9.portable.x64\notepad++.exe
      Command Line : 
      Admin mode : OFF
      Local Conf mode : ON
      Cloud Config : OFF
      OS Name : Windows 10 Pro (64-bit) 
      OS Version : 21H2
      OS Build : 19044.2604
      Current ANSI codepage : 1252
      Plugins : 
          mimeTools (2.9)
          NavigateTo (2.4.1)
          NppConverter (4.5)
          NppExec (0.8.2)
          NppExport (0.4)
          PythonScript (2)
          SurroundSelection (1.4.1)
          VisualStudioLineCopy (1.0.0.2)
          _CustomizeToolbar (5.3)
      
      Michael VincentM 1 Reply Last reply Reply Quote 1
      • Michael VincentM
        Michael Vincent @Neil Schipper
        last edited by

        @Neil-Schipper said in SurroundSelection sometimes hijacks shortcut Ctrl+Shift+2:

        I (and maybe also dail) would like to know if other people are seeing the same behavior.

        Oh, yeah - me too! I never use that key combo though so would probably never have noticed it.

        Cheers.

        1 Reply Last reply Reply Quote 2
        • rdipardoR
          rdipardo
          last edited by

          This appears to fix it:

          diff --git a/src/Main.cpp b/src/Main.cpp
          index 2b159ef..030e2db 100644
          --- a/src/Main.cpp
          +++ b/src/Main.cpp
          @@ -77,8 +77,11 @@ static void prepareKeyboardChars() {
           	kbProcessChars.clear();
           
           	// Default characters
          -	for (UCHAR c : "\"'(){}[]<>`")
          +	const char *defaultChars = "\"'(){}[]<>`";
          +	for (unsigned i = 0; defaultChars[i]; i++) {
          +		UCHAR c = (UCHAR)defaultChars[i];
           		processChars[c] = TRUE;
          +	}
           
           	// Add user defined
           	for (SIZE_T i = 0, j = _tcslen(addChars); i < j; i++)
          

          Explanation and patched binaries here.

          Neil SchipperN 1 Reply Last reply Reply Quote 2
          • Neil SchipperN
            Neil Schipper @rdipardo
            last edited by

            @rdipardo Thanks for the prompt attention. As it turns out I can’t test the fix for a day or a few (due to: house sitting, guest account, Norton prevents extracting dll from downloaded zip).

            rdipardoR 1 Reply Last reply Reply Quote 0
            • rdipardoR
              rdipardo @Neil Schipper
              last edited by rdipardo

              Norton prevents extracting dll from downloaded zip).

              If anyone visiting this thread is in similar circumstances, AppVeyor artifacts will be online until about MAR-28-2023:

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