Fix evil-open-above in auto-filled comments
If comment-auto-fill-only-comments is enabled, evil-open-above (O) can break comments, e.g. in haskell -- 1 :. 2 :. 3 :. Nil -- |a -- Becomes -- 1 :. 2 :. 3 :. Nil -- | -- a -- Reported by @ar1a
This commit is contained in:
parent
99b7b7f740
commit
09f9e12638
1 changed files with 4 additions and 2 deletions
|
@ -8,7 +8,8 @@
|
|||
(funcall orig-fn count)
|
||||
(cl-letf (((symbol-function 'evil-insert-newline-below)
|
||||
(lambda ()
|
||||
(let ((pos (save-excursion (beginning-of-line-text) (point))))
|
||||
(let ((pos (save-excursion (beginning-of-line-text) (point)))
|
||||
comment-auto-fill-only-comments)
|
||||
(evil-narrow-to-field
|
||||
(evil-move-end-of-line)
|
||||
(require 'smartparens)
|
||||
|
@ -31,7 +32,8 @@
|
|||
(funcall orig-fn count)
|
||||
(cl-letf (((symbol-function 'evil-insert-newline-above)
|
||||
(lambda ()
|
||||
(let ((pos (save-excursion (beginning-of-line-text) (point))))
|
||||
(let ((pos (save-excursion (beginning-of-line-text) (point)))
|
||||
comment-auto-fill-only-comments)
|
||||
(evil-narrow-to-field
|
||||
(require 'smartparens)
|
||||
(if (save-excursion (nth 4 (sp--syntax-ppss pos)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue