plugin Extended Selection

Plugins for SynWrite and CudaText...
Post Reply
Shovel
Posts: 141
Joined: 31.12.2019 10:16

plugin Extended Selection

Post by Shovel »

A plugin to streamline the introduction of copy-paste bugs.
Adds to usual double-click selection:

Shift+Double-click: includes additional characters to selection
Shift+Triple-click: "expression selection" (useful for selecting function call with arguments)

-----------------------------

Plugin has options in the config file, call menu item
"Options / Settings-pligins / Extended Selection":

Each lexer has following options:
"include_chars": additional characters to include in Shift+double-click selection.
"stop_ext": characters to stop Shift+triple-click selection when not enclosed in ()[]{}<>
"open_chars" and "close_chars": map of opening-to-closing and closing-to-opening brackets. Used to limit selection extension to stay within brackets, and to ignore "stop_ext" characters inside brackets, when they follow selected text.

For example when 'cc' clicked in following line:

Code: Select all

	aa = bb.cc<dd>(ee=ff) = ww

* normal double-click will yield selection:

Code: Select all

	cc
* addon's shift+double-click:

Code: Select all

	bb.cc
(period and adjacent text is added to selection because '.' is in the "include_chars" for this lexer)
* addon's shift+triple-click:

Code: Select all

	bb.cc<dd>(ee=ff)
(selection stops at equal-signs at both sides because '=' is in the "stop_ext" for this lexer. "stop_ext" characters ('=' here) are ignored inside brackets)

-----------------------------

Commands in "Plugins / Extended Selection" menu:

- "Toggle Selection"
Cycle through addon's double/triple-click selections.

-----------------------------

Author: Shovel (CudaText forum user)
Attachments
selection_example.png
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

1) I suggest to add command to the plugin. so user can call "expand selection" via the command.
not only by dbl-click. this way plugin can be used w/o dbl-clicks.
2) consider to add Markdown features
https://github.com/Alexey-T/CudaText/issues/3015
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

> 1)
I added the menu entry. It cycles through modified double/triple clicks.

> 2)
With some modifications this plugin probably can be coerced into behaving somewhat similarly... but I don't think I will have that much free time in the near future.
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

Ok, added the readme. Please check it out, I think now readme and default config covers most things, and it seems like adding more info would only make thinks more confusing :) your opinion?
https://github.com/halfbrained/cuda_ext ... readme.txt
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

thanks! renamed the plugin to 'your name' Extended Selection. updated in addons.
micro issue: the name 'Extended Selection' should be in all places in install.inf.
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

Fixed the install.inf
Post Reply