We’ve been hard at work on the new Script Editor and today we’re very excited to introduce new features that will make development in Studio more intuitive and easy to use.
Easy Code Formatting
Now you can format your code instantly based on your indentation rule! Select any block of code (or the entire document) and then use one of the following options to format your code:
Hotkey: Option+Shift+F for Mac and Alt+Shift+F for Windows
This hotkey is also customizable from File > Advanced > Customize Shortcut
Right click context menu
- Ribbon bar under the Script Menu
Pasting code into Studio just got a lot easier!
Any code you copy outside of Studio and paste into the script editor will automatically be formatted according to your preferences!
This is the old behavior:
If you would like to turn this off, go to File > Settings > Studio > Format on Paste
The War Between Tabs vs Spaces
Up until now you could only indent using Tabs in Studio. BUT for people that are interested, you can now use spaces to indent and customize the space width accordingly. Roblox recommends using tabs for indentation and that will be the default.
To turn this feature on, go to Settings > Studio > Indent Using Spaces
New Hotkeys for Indenting & Unindenting Your Code
Tab and shift/tab have been the only way to indent and unindent your code so far. Now you can use Cmd+] to indent and Cmd+[ to unindent (or Ctrl+] to indent and Ctrl+[ to unindent in Windows). These shortcuts are also customizable in the File > Advanced > Customize Shortcuts menu
Multi-line Comments & Strings
Note that multi-line comments and strings are not subject to indentation rules! We did this to prevent formatting rules from getting in the way when you want to have a comment.
We constantly listen to feedback from the dev community and fix bugs as we find them. The following issues have been fixed based on developer feedback:
Easy Script Switching
We wanted to make it easier to switch between scripts in Studio so now you can use Ctrl+Space on Mac (Ctrl+Tab on Windows) to easily cycle between Scripts and open tabs in Studio. They will be ordered by the most recently used script and you can change the shortcut through File > Advanced > Customize Shortcuts menu
Quickly Find Your Cursor
We’ve heard that it’s sometimes hard to find your cursor in the script editor, so we wanted to make that easier by highlighting the current line your cursor is on!
No more scrolling and moving around just to find the blinking cursor, now your current line is highlighted in light blue and you can customize it from File > Settings > Current Line Highlight Color
As always, please let us know if you have any feedback.