Merge pull request #693 from toctan/fix-python-electric-rule

Fix python electric layout newline
This commit is contained in:
Bozhidar Batsov 2014-09-18 18:03:37 +03:00
commit 0722ab665f

View file

@ -87,8 +87,9 @@
(eldoc-mode) (eldoc-mode)
(setq-local electric-layout-rules (setq-local electric-layout-rules
'((?: . (lambda () '((?: . (lambda ()
(if (python-info-statement-starts-block-p) (and (zerop (first (syntax-ppss)))
'after))))) (python-info-statement-starts-block-p)
'after)))))
(when (fboundp #'python-imenu-create-flat-index) (when (fboundp #'python-imenu-create-flat-index)
(setq-local imenu-create-index-function (setq-local imenu-create-index-function
#'python-imenu-create-flat-index)) #'python-imenu-create-flat-index))