godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.45k stars 20.25k forks source link

GDSscript Editor Indent/Outdent Keyboard Shortcut #17540

Closed xudz closed 4 years ago

xudz commented 6 years ago

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.

Zylann commented 6 years ago

Select text and press tab or Shift+tab?

xudz commented 6 years ago

I tried that but it doesn't work. It's not even showing up in the menus as an option.

Zylann commented 6 years ago

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?

xudz commented 6 years ago

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.

Zireael07 commented 6 years ago

Indent/outdent have been null by default since 3.0 for me, so something to look at?

xudz commented 6 years ago

Agreed.

Re-opened to have the team look at enabling these by default.

vnen commented 6 years ago

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.

robfram commented 6 years ago

Just test this. No shortcut assigned to indent/dedent and Tab/Shift+Tab work perfectly in the editor.

GalanCM commented 6 years ago

A lot of editors (Atom, VSCode, etc.) use Control + [ and Control + ] for this.

kidrigger commented 6 years ago

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

Calinou commented 4 years ago

This is implemented since Godot 3.0 (Tab and Shift + Tab), closing.