mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-07 14:21:47 -08:00
fix(electric): reorder electric-quote hook to run before smartparens
When `electric-quote-mode' is enabled with smartparens, the `electric-quote-inhibit-functions' check (e.g. `org-in-src-block-p') fails because smartparens' post-self-insert handler runs first and interferes with buffer state. Re-add the electric-quote handler at depth -50 so it runs before smartparens (depth 0). Fix: #5051 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
76277e246f
commit
2ebac3ccfc
1 changed files with 10 additions and 1 deletions
|
|
@ -15,4 +15,13 @@ current line.")
|
|||
(when (and (eolp) +electric-indent-words)
|
||||
(save-excursion
|
||||
(backward-word)
|
||||
(looking-at-p (concat "\\<" (regexp-opt +electric-indent-words))))))))
|
||||
(looking-at-p (concat "\\<" (regexp-opt +electric-indent-words)))))))
|
||||
|
||||
;; Fix #5051: Ensure electric-quote's handler runs before smartparens' on
|
||||
;; `post-self-insert-hook', so that `electric-quote-inhibit-functions'
|
||||
;; (e.g. `org-in-src-block-p') is respected in org src blocks.
|
||||
(add-hook! 'electric-quote-mode-hook
|
||||
(defun +electric-quote-reorder-post-self-insert-h ()
|
||||
(when electric-quote-mode
|
||||
(remove-hook 'post-self-insert-hook #'electric-quote-post-self-insert-function)
|
||||
(add-hook 'post-self-insert-hook #'electric-quote-post-self-insert-function -50)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue