Page 1 of 1
Smart tabs?
Posted: 20.03.2023 20:49
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?
Posted: 21.03.2023 12:23
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.
Posted: 21.03.2023 13:25
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?
Posted: 21.03.2023 20:44
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).
Posted: 21.03.2023 20:51
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.
Posted: 21.03.2023 21:43
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).
Posted: 06.04.2023 11:44
by main Alexey
Added the option, see the Github 'issues' where I gave the beta for win64.
Posted: 06.04.2023 20:55
by qwerky
Excellent! This is a great feature; seems others like it as well. Thank you!