• Login
Community
  • Login

Control+B does not work correctly. Why?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
ctrl+b
5 Posts 4 Posters 1.7k 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
    W TX
    last edited by May 22, 2019, 5:19 AM

    I am a new user with Notepad++, and I have a vhd file and following statement:

    Accept_O(0) <= D0_I and ((not D1_I_First and (not A0_Valid or A0_Go)) 
    	or (D1_I_First and (not A1_Valid or A1_Go)));
    

    When I press Ctrl+B, in forward direction it works correctly, but in backward direction, it sometimes work, sometimes doesn’t for two continuous “))”. If it is “) )” with a space added between the two continuous “))”, it always works.

    I position the cursor on a ‘(’, press Ctrl+B twice, the cursor should return to the starting place, but sometimes it does not work.

    Very troublesome!

    Weng

    M 1 Reply Last reply May 22, 2019, 9:25 AM Reply Quote 0
    • M
      Meta Chuh moderator @W TX
      last edited by May 22, 2019, 9:25 AM

      welcome to the notepad++ community, @W-TX

      this issue exists in older and newer versions of notepad++.

      currently the only way i know, to get ctrl+b (go to matching brace) working on your given example, is by installing the textfx plugin (officially only available for 32 bit) as it includes a fix for this problem.

      without textfx, notepad++ is currently not able to correctly jump to the matching closing bracket on consecutive multiple brackets.

      best regards.

      1 Reply Last reply Reply Quote 1
      • M
        Michael Vincent
        last edited by May 22, 2019, 4:43 PM

        I did some testing - seems like the simple fix is to advance one space after Ctrl+B to put the cursor on the “outside” of the closing parenthesis, brace, bracket. I wonder if that could be done by remapping Ctrl+B to a PythonScript or LuaScript?

        1 Reply Last reply Reply Quote 1
        • M
          Michael Vincent
          last edited by Michael Vincent May 22, 2019, 5:00 PM May 22, 2019, 5:00 PM

          In fact, you could create this NppExec script and map it to Ctrl+B - removing the current Ctrl+B shortcut:

          NPP_CONSOLE keep
          SCI_SENDMSG SCI_GETCURRENTPOS
          SCI_SENDMSG SCI_BRACEMATCH $(MSG_RESULT)
          SET POSITION ~ $(MSG_RESULT) + 2
          SCI_SENDMSG SCI_GOTOPOS $(POSITION)

          A 1 Reply Last reply May 22, 2019, 5:21 PM Reply Quote 1
          • A
            Alan Kilborn @Michael Vincent
            last edited by May 22, 2019, 5:21 PM

            @Michael-Vincent

            IMO that isn’t a great solution either because, when you repeat the operation, without first moving the caret manually, you should again end up where you start. And in the case of your NppExec script, and the OP’s original text, that doesn’t happen when you start with your insert caret just to the left of ((not.

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