Community
    • Login

    Control+B does not work correctly. Why?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    ctrl+b
    5 Posts 4 Posters 2.2k Views 1 Watching
    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 TXW Offline
      W TX
      last edited by

      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

      Meta ChuhM 1 Reply Last reply Reply Quote 0
      • Meta ChuhM Offline
        Meta Chuh moderator @W TX
        last edited by

        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
        • Michael VincentM Offline
          Michael Vincent
          last edited by

          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
          • Michael VincentM Offline
            Michael Vincent
            last edited by Michael Vincent

            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)

            Alan KilbornA 1 Reply Last reply Reply Quote 1
            • Alan KilbornA Offline
              Alan Kilborn @Michael Vincent
              last edited by

              @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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors