Community
    • Login

    Doubleclick on delimiter

    Scheduled Pinned Locked Moved General Discussion
    10 Posts 3 Posters 3.3k 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.
    • A KA
      A K
      last edited by A K

      The idea is simple: After double clicking on the delimiter, the text is selected to another delimiter.

      If someone liked it, I ask you to support the idea with your posts, which would show the developers the importance of the feature.

      doubleclick on delimiter

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @A K
        last edited by Scott Sumner

        @A-K

        Keyboard is easier (trying to double click a single character with a smallish font turns it into a video game).

        Keyboard Ctrl+Alt+B

        If you truly like the mouse option, you could replicate this behavior with a scripting plugin, e.g. Pythonscript.

        1 Reply Last reply Reply Quote 1
        • A KA
          A K
          last edited by

          It’s not a problem. And we can use the keyboard.

          But it seems to me that such behavior is natural.
          If you double-click on a word, it becomes highlighted.
          If you double-click on the parenthesis, what is between the parenthesis becomes highlighted.

          It will be convenient if this becomes the native behavior of the program.

          1 Reply Last reply Reply Quote 0
          • Scott SumnerS
            Scott Sumner
            last edited by

            So purely for fun, here’s the Pythonscript version:

            def callback_sci_DOUBLECLICK(args):
                ap = args['position']
                if editor.getTextRange(ap, ap) in '([{}])': notepad.menuCommand(43053)
            editor.callback(callback_sci_DOUBLECLICK, [SCINTILLANOTIFICATION.DOUBLECLICK])
            
            1 Reply Last reply Reply Quote 3
            • A KA
              A K
              last edited by

              @Scott-Sumner said:

              So purely for fun, here’s the Pythonscript version

              And it’s all? Only four lines?
              In this case, the developers really need to include this feature in the program.

              Now a double click on the delimiter has no reasonable behavior.

              1 Reply Last reply Reply Quote 0
              • dailD
                dail
                last edited by

                Currently, if you Ctrl+Double Click anywhere inside the delimiter pair it selects everything inside.

                1 Reply Last reply Reply Quote 3
                • A KA
                  A K
                  last edited by

                  @dail said:

                  Currently, if you Ctrl+Double Click anywhere inside the delimiter pair it selects everything inside.

                  This is a nice feature! Thanks for the tip!

                  But the current implementation of the feature has two weaknesses.

                  1. If there are several lines between delimiters, the feature does not work.
                  2. Delimeters are not selected at the beginning and end (Ctrl+Alt+B does this).

                  So, it would be useful to add to the current implementation double click on the delimiter.

                  dailD 1 Reply Last reply Reply Quote 0
                  • dailD
                    dail @A K
                    last edited by

                    @A-K said:

                    1. If there are several lines between delimiters, the feature does not work.

                    Settings > Preferences > Delimiter > Allow on several lines

                    1. Delimeters are not selected at the beginning and end (Ctrl+Alt+B does this).

                    You are correct. In most cases I find I don’t want the delimiters selected (for example selecting all the parameters within a function call) but under some cases (such as yours) I do see it helpful to have the delimiters selected as well.

                    1 Reply Last reply Reply Quote 2
                    • Scott SumnerS
                      Scott Sumner
                      last edited by

                      Maybe worth pointing out that the Ctrl + double-left-click method only works for ONE type of delimiter (whatever is configured in the Delimiter preferences). The Pythonscript method handles several types, specifically { }, [ ] and ( ).

                      1 Reply Last reply Reply Quote 3
                      • A KA
                        A K
                        last edited by

                        @dail said:

                        Settings > Preferences > Delimiter > Allow on several lines

                        It solves almost all problems!
                        In this case, we only need an option that sets whether to select delimiters or not.

                        Of course Scott is right, delimiters should be assigned to the current language. Or at an additional setting.

                        And further. It would be nice to have [ctrl + alt + b] work anywhere between the parentheses (like dblclck + ctrl). In this case, if you press [ctrl + alt + b] several times, the selection should expand to the next and next delimiters.

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