• Login
Community
  • Login

SurroundSelection sometimes hijacks shortcut Ctrl+Shift+2

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 3 Posters 338 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.
  • N
    Neil Schipper
    last edited by Feb 25, 2023, 11:13 PM

    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)
    
    M 1 Reply Last reply Feb 26, 2023, 5:08 PM Reply Quote 1
    • M
      Michael Vincent @Neil Schipper
      last edited by Feb 26, 2023, 5:08 PM

      @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
      • R
        rdipardo
        last edited by Feb 26, 2023, 9:56 PM

        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 .

        N 1 Reply Last reply Feb 26, 2023, 11:40 PM Reply Quote 2
        • N
          Neil Schipper @rdipardo
          last edited by Feb 26, 2023, 11:40 PM

          @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).

          R 1 Reply Last reply Mar 1, 2023, 2:34 AM Reply Quote 0
          • R
            rdipardo @Neil Schipper
            last edited by rdipardo Mar 1, 2023, 2:35 AM Mar 1, 2023, 2:34 AM

            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
            4 out of 5
            • First post
              4/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors