-
Notifications
You must be signed in to change notification settings - Fork 77
moved ruby's electric indent to lua-mode #112
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
base: master
Are you sure you want to change the base?
Conversation
now, when typing a closing token like _end_, an automatically reindent will be performed. it also works for _else_ _elseif_ _until_ function foo() ... en end<- in the above example, typing 'd' will invoke the automatically reindent
Hi and thank you for the PR. Electric indentation of block closing tokens is already implemented via If you don't mind doing some refactoring to select the one that is appropriate for the running version of emacs on top of your slightly adapted copy-n-paste, I'll gladly accept that. |
Thanks for your quick reply. I'm using emacs 24.5 actually, so I guess there may be some surprise for me since electric indent doesn't work for me out of the box(I've tried toggle lua-toggle-electric-state but didn't see any difference) And as for the code I copied, I'll try to make them clean to provide those who need a fallback. Got to learn something but that will be OK, just need some time. |
@fangzhouuu you might need to enable |
Well I've enable abbrev-mode but it still not working for |
You can do If you have cask, you can use |
Also, there are tests for electric indentation functionality: lua-mode/test/test-electric-mode.el Lines 35 to 71 in 0b41d44
|
Copied from ruby-mode.el
now, when typing a closing token like end, an automatically reindent
will be performed. it also works for else elseif until. (I did a quick
scan on lua syntax, described in lua manual and don't think there will be
more keyword which trigger a reindent)
example:
I'm been using this for almost a month and everything seems to be ok, though in fact I'm not very familiar with elisp, so better have a look at the code and do some extra test.