-
-
Notifications
You must be signed in to change notification settings - Fork 548
Code Editor upgrades: structured s-expresion edition and emacs-mode #2117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@sthilaid what are your thoughts moving the cursor to the inner s-expression |
oh also, would we be able to add quotations |
@AlecTroemel, very good suggestions, i'm going to implement both of those right away! |
…sor inside the new sexp / str. Strings are now also part of structured editing (the editor tries it's best to keep them balanced)
done and done! it was a bit more work to add the double quotes to structured edition but it was an involuntary omition on my end! good catch! From my tests, it seems to be working well, hopefully there isn't too many holes in my logic. |
src/studio/config.c
Outdated
@@ -238,6 +238,7 @@ static void setDefault(Config* config) | |||
.volume = MAX_VOLUME, | |||
.vsync = DEFAULT_VSYNC, | |||
.fullscreen = false, | |||
.emacsMode = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you pls move all the emacs mode declarations under #if defined(BUILD_EDITORS)
definition, which will allow not including this option for special builds without editors?
src/studio/system.h
Outdated
@@ -128,6 +128,7 @@ typedef struct | |||
bool vsync; | |||
s32 volume; | |||
tic_mapping mapping; | |||
bool emacsMode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here, please :)
ok done, I also added a define in the key bindings menu to return back to the proper element when the code editor option is not defined |
|
There seems to be some issues with the actions today, I don't know how to resolve these problems. For instance:
@nesbox do you know what the issue is? |
lol, okay that worked... seems like the build action or not super reliable! ;p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems everything looks good
Thank you
I would like to add some documentation about these changes, when should I modify the wiki to explain them. When will version 1.1 be released? (no point in adding the doc if it's not in the users' hands) Also, is there a roadmap of incoming changes. Is there stuff you need help with that I could maybe give a hand? |
I was looking at this. |
Yes, GitHub Issues is our roadmap, |
Excellent, I added the info to the wiki, thanks! |
Hi! This pull request adds two main features:
= Structured edition =
This functionality mimics some functionality provided by the great paredit-mode in emacs. It helps s-expression (lisp like language code structure) edition by giving you tools to create / remove expressions and enforces (to a certain extent) the balance of parenthesis. It is still missing an automatic code alignment, but this might come in later.
= emacs-mode =
This code editor mode changes a lot of bindings to be a lot more compatible with emacs users. It also brings some new features like deleteLine, startLine and some modified functionnality for others. It also fixes what I believe is a bug in endLine (which before the fix would bring you to the end of the code buffer). To enable this, I added a new submenu called Code Editor Options which has this "emacs mode" option embeded.
= tic_script_config additions =
I added options in the language config to customize the isalnum function used when parsing their code. For instance, scheme allows a lot of normally forbidden characters in their symbols (stuff like ':' or '#'). This allows any language to customize it. In a similar fashion, there is also an option to override the API function names for that language so that the code highlight will correctly recognize them if they were modified for that language (for example, if there is a prefix). Finally, there is an option to enable structured edition for that language.
Let me know what you think!