emacs-ess / ess-stata-mode

4 stars 5 forks source link

blocks inside curly braces do not auto indent #3

Closed djh1202 closed 3 years ago

djh1202 commented 3 years ago

in a conditional or for loop inside braces { } , do not automatically indent as they used to

BrendanHalpin commented 3 years ago

As far as I know, support for indentation was removed quite some time ago

BrendanHalpin commented 3 years ago

Support was withdrawn because indentation was driven by the R indentation framework, and it was felt inappropriate to support this (it is clearly imperfect).

You can re-activate R-style indentation by putting the following after (require 'ess) in your startup:

(require 'ess-r-mode)
(add-to-list 'STA-customize-alist '(indent-line-function . #'ess-r-indent-line))
djh1202 commented 3 years ago

Thanks! I had to change (require 'ess-r-mode) to (require 'ess-stata-mode) in my init file, but after that it worked.