mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-31 14:43:40 -05:00
refactor(lib): don't use smartparens' API
Toward our eventual goal of moving smartparens out of core, I've adapted this from code provided by hpfr on Discord, which was adapted from smartparen's syntax-ppss caching logic. `:config default` will need need some attention before we can fully move smartparens to its own `:editor smartparens` module. Co-authored-by: hpfr <hpfr@users.noreply.github.com>
This commit is contained in:
@@ -78,10 +78,9 @@ more information on modifiers."
|
||||
(defun +evil--insert-newline (&optional above _noextranewline)
|
||||
(let ((pos (save-excursion (beginning-of-line-text) (point)))
|
||||
comment-auto-fill-only-comments)
|
||||
(require 'smartparens)
|
||||
(evil-narrow-to-field
|
||||
(if above
|
||||
(if (save-excursion (nth 4 (sp--syntax-ppss pos)))
|
||||
(if (save-excursion (nth 4 (doom-syntax-ppss pos)))
|
||||
(evil-save-goal-column
|
||||
(setq evil-auto-indent nil)
|
||||
(goto-char pos)
|
||||
@@ -103,7 +102,7 @@ more information on modifiers."
|
||||
(forward-line -1)
|
||||
(back-to-indentation))
|
||||
(evil-move-end-of-line)
|
||||
(cond ((sp-point-in-comment pos)
|
||||
(cond ((doom-point-in-comment-p pos)
|
||||
(setq evil-auto-indent nil)
|
||||
(if comment-line-break-function
|
||||
(funcall comment-line-break-function nil)
|
||||
|
Reference in New Issue
Block a user