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:
Henrik Lissner 2024-07-09 19:27:36 -04:00
parent 1131d5b36d
commit e43d575caf
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
6 changed files with 70 additions and 33 deletions

View file

@ -57,13 +57,13 @@ See `+evil/next-preproc-directive' for details."
(require 'newcomment)
(dotimes (_ (abs count))
(cond ((> count 0)
(while (and (not (eobp)) (sp-point-in-comment))
(while (and (not (eobp)) (doom-point-in-comment-p))
(forward-line 1))
(unless (comment-search-forward (point-max) 'noerror)
(goto-char orig-pt)
(user-error "No comment after point")))
(t
(while (and (not (bobp)) (sp-point-in-comment))
(while (and (not (bobp)) (doom-point-in-comment-p))
(forward-line -1))
(unless (comment-search-backward nil 'noerror)
(goto-char orig-pt)