Replies: 1 comment 2 replies
-
This is how most editors out there behave, such as Visual Studio Code. Dedent always works regardless of cursor option, but indent inserts a tab at cursor location as you may be using tabs for alignment (or writing literal tab characters in strings). |
Beta Was this translation helpful? Give feedback.
-
I would like "ui_text_indent" to indent a whole line, rather than adding a tab at caret position.
While coding I noticed that pressing "Tab" ("ui_text_indent") will insert a tab character at the caret's position. However, pressing "Shift+Tab" ("ui_text_dedent") will remove a tab character from the beginning of the line. This is confusing and inconsistent, as in order to indent a whole line, one would have to highlight a portion of the text and then press tab - i.e "Shift+Right" and then "Tab".
I would like to be able to indent a whole line without having to select parts of the text first, regardless of caret's position. It makes little sense to add tabs in the middle of a line, and the only use cases I can think of where indentation would be useful anywhere but the beginning of a line is when trying to align comments at the end of a line, or when trying to align key-value pairs in a dict definition.
ui_text_indent
callsdo_indent()
, which is hard-coded to only callindent_lines()
when the carethas_selection
, as shown in code_edit.cpp#L858. It would be nice if a change were made to make it possible to indent the current line without having to select anything, or even making it the default action forui_text_indent
considering it is a much much more common use-case.Beta Was this translation helpful? Give feedback.
All reactions