Doubleclick on delimiter
-
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.
-
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.
-
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.
-
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])
-
@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.
-
Currently, if you
Ctrl+Double Click
anywhere inside the delimiter pair it selects everything inside. -
@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.
- If there are several lines between delimiters, the feature does not work.
- 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.
-
@A-K said:
- If there are several lines between delimiters, the feature does not work.
Settings > Preferences > Delimiter > Allow on several lines
- 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.
-
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( )
. -
@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.