Open buhman opened 6 years ago
What you're seeing is different levels of "bounce indenting" in order to achieve alignment with elements such as the empty list on the line above. If you want to disable that, it looks like you can (add-hook 'elm-mode-hook 'turn-off-elm-indent)
.
P.S. I personally feel that the best solution is to embrace elm-format
... :-)
If you want to disable [bounce indenting] … you can
(add-hook 'elm-mode-hook 'turn-off-elm-indent)
It seems like this has the opposite effect, elm-indent doesn't seem to be bounce-indenting, while turning it off does bounce-indent:
I've made this more straightforward in the latest code, which should build into a MELPA package automatically in the next few hours: specifically, all you'll need to do will be (remove-hook 'elm-mode-hook 'elm-indent-mode)
.
The "bounce indentation" you're seeing without elm-indent-mode
is your Emacs-wide default behaviour of trying to align indentation with previous indentations. In the latter screen capture, with elm-indent-mode
, it looks like it's positioning the [
relative to where it thinks the [ ]
should be, not where it is.
all you'll need to do will be (remove-hook 'elm-mode-hook 'elm-indent-mode)
I do like the cycling though, is it not possible to make it match elm-format behavior, or at least snap to a multiple of 4 spaces?
If you want multiples of 4 spaces, there'll be a default Emacs indentation function for that. Re. exactly matching elm-format
, I doubt that will happen, since the indentation system is already quite complex. If the elm-format
style is the right one for you, elm-format-on-save
is the way to go IMO: indent with tab until syntactically valid, then save. That's my personal strategy. :-)
I've made this more straightforward in the latest code, which should build into a MELPA package automatically in the next few hours: specifically, all you'll need to do will be
(remove-hook 'elm-mode-hook 'elm-indent-mode)
.
For me, I took this approach. At least with this, the new line isn't adding a "tab" of its own.
I expect 4 spaces, but I get very strange combinations of 6, 2, and 1-space, depending on moon phase and cosmic rays.