Add Shift+Return shortcut to the code editor that auto-closes a block#1721
Merged
nesbox merged 1 commit intonesbox:masterfrom Dec 17, 2021
Merged
Add Shift+Return shortcut to the code editor that auto-closes a block#1721nesbox merged 1 commit intonesbox:masterfrom
nesbox merged 1 commit intonesbox:masterfrom
Conversation
nesbox
requested changes
Dec 6, 2021
src/studio/editors/code.c
Outdated
| } | ||
|
|
||
| // Add an "end" keyword, and put the cursor in the line between. | ||
| static void newLineWithEnd(Code* code) |
Owner
There was a problem hiding this comment.
TIC-80 also supports other scripts langs like JS, Squirrel, Wren, Fennel, and Moonscript. Please add the function "end" depending on lang, you can define it in tic_script_config struct (for example const char* end = tic_core_script_config(tic)->functionEnd;).
Thank you.
Owner
|
Any progress here? |
For example, in Ruby and Lua, it would insert an "end" keyword, and place the cursor in an indented line between.
Contributor
Author
|
Good point about the multiple langs! I called the struct entry For Lua and Ruby, it's Ready for review again! :) |
nesbox
added a commit
that referenced
this pull request
Dec 28, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a convenience feature shamelessly stolen from PICO-8: when pressing Shift+Return in the code editor, insert an
endstatement, and put the cursor in an indented line in-between. For example, we go fromto
I would love to use this during speedcoding! Is this a welcome feature? Does this PR look alright?