Smart tabs?

Post Reply
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Smart tabs?

Post by qwerky »

Perhaps there is a setting for this that I cannot find? I'm looking for "smart tabs": when pressing the Tab key, text on the current line, from the current caret, is moved right to the column of the first non-whitespace character in the line above, which is to the right of the current column; if the above line has no characters to the right of the current column, then to the first non-whitespace character to the right in the line above that, etc., even to the top of file. If there are multiple carets, they should all move right the same number of columns. If the caret is in a selection, and if 'key_tab_indents_sel' is True, then the Tab key press should just do the regular indent; otherwise it should move the entire selection according to above.

This is a common editor feature. Does Cudatext have this? If not, could it be added?
main Alexey
Posts: 2257
Joined: 25.08.2021 18:15

Post by main Alexey »

It should be added in a python plugin.
post a request to our our GIthub https://github.com/Alexey-T/CudaText/issues as it's more visited.

Cud has only similar setting for option "indent_kind", it's when you press ENTER on line end.
main Alexey
Posts: 2257
Joined: 25.08.2021 18:15

Post by main Alexey »

Do you know how to perform this in Sublime Text and VSCode?

EDIT
I did not find how to do SmartTabs in Sublime / VSCode! so they have it via plugins? so we need to have a plugin too?
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Sorry, I don't have VSCode or Sublime (not free). I just checked and found smart tabs are in ConTEXT, PSPad, and Textadept. I use them all the time; they are incredibly useful. Textadept is based on the Scintilla edit control (as is Notepad++ and SciTE).
main Alexey
Posts: 2257
Joined: 25.08.2021 18:15

Post by main Alexey »

What option do you suggest? e.g. "tab_smart" true/false? You may show here options for smart-tab in 3 editors you mentioned.
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

ConTEXT has, in settings, option: "Smart tabs", which may be checked or unchecked.
PSPad has, in settings, option: "Smart Tabs", which may be checked or unchecked.
Textadept: apologies, it appears that this capability is not native, but is a function that I added to Textadept years ago, with a user-defined hotkey to toggle it on/off.

So, your suggestion "tab_smart" true/false is good; to make it toggle on/off is not really necessary (just a nice convenience).
main Alexey
Posts: 2257
Joined: 25.08.2021 18:15

Post by main Alexey »

Added the option, see the Github 'issues' where I gave the beta for win64.
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Excellent! This is a great feature; seems others like it as well. Thank you!
Post Reply