Closed xudz closed 4 years ago
Select text and press tab or Shift+tab?
I tried that but it doesn't work. It's not even showing up in the menus as an option.
Weird, I use this all the time, like all regular code editors have that Oo You say it doesn't work, do you mean it replaces selected text by one tab?
Well, that was silly of me.
I checked the key mappings in Godot and in/outdent were set to null (by default?).
I just set them manually and everything works peachy now.
Still, it might be nice to have these set by default on a new installation, assuming what I am seeing is typical.
Indent/outdent have been null by default since 3.0 for me, so something to look at?
Agreed.
Re-opened to have the team look at enabling these by default.
AFAIK Tab and Shit+Tab works independently of that option, if the text is selected. The shortcuts used to be Alt+Left and Alt+Right, but now that's used for Back/Forward in history, so they were removed from indent/dedent.
Just test this. No shortcut assigned to indent/dedent and Tab/Shift+Tab work perfectly in the editor.
A lot of editors (Atom, VSCode, etc.) use Control + [ and Control + ] for this.
Confirming Tab/Shift+Tab working on no shortcuts on macOS, I think I'll add Control+[ and Control+] (CMD+[ and CMD+] on macOS) as defaults
Edit: Found comment telling to leave at null. https://github.com/godotengine/godot/blob/29b8364ef09f32467070ac34051f2bc2e2d84ebf/editor/plugins/script_text_editor.cpp#L1726-L1730
This is implemented since Godot 3.0 (Tab and Shift + Tab), closing.
With indenting and outdenting text being such common operations in Pythonesque GDScript, it would be useful to be able to indent and outdent selected blocks of text with a keyboard shortcut instead of having to navigate a right-click menu for each in/outdent.