mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-13 13:13:35 -05:00
fix(latex): disable smartparens pairs conflicting with AucTeX
This disables smartparens pairs for quotation marks, which are broken. Before this commit, typing a LaTeX comment % "Foo" inserted % ''Foo`|`'' where | indicates the position of the cursor (wtf!). Let's better AucTeX's support for quotation marks for now and accept that the user won't get automatic insertions of closing quotation marks. This also removes a wrong comment mentioning the non-existing variable `+latex-enable-plain-double-quotes'.
This commit is contained in:
committed by
Henrik Lissner
parent
ac530efe87
commit
9219fa7c08
@@ -96,11 +96,16 @@ okular and pdf-tools.")
|
||||
"\\bigl\\{" "\\biggl\\{" "\\Bigl\\{" "\\Biggl\\{"
|
||||
"\\lfloor" "\\lceil" "\\langle"
|
||||
"\\lVert" "\\lvert"
|
||||
"`"))
|
||||
(sp-local-pair modes open nil :actions :rem))
|
||||
;; And tweak these so that users can decide whether they want use LaTeX
|
||||
;; quotes or not, via `+latex-enable-plain-double-quotes'.
|
||||
(sp-local-pair modes "``" nil :unless '(:add sp-in-math-p))))
|
||||
;; Disable pairs that interfere with AucTeX,
|
||||
;; see https://github.com/Fuco1/smartparens/pull/1151.
|
||||
"`" "``" "\""))
|
||||
;; Some of the above pairs are in smartparens' global list, which
|
||||
;; applies to all modes, so we need a local ":actions nil" override
|
||||
;; (instead of ":actions :rem", which removes from the local list).
|
||||
;; While this keeps the pairs in `sp-pairs', it has negligible
|
||||
;; performance impact because smartparens will omit the pairs when
|
||||
;; building the buffer-local `sp-local-pairs' used during operation.
|
||||
(sp-local-pair modes open nil :actions nil))))
|
||||
;; Hook LSP, if enabled.
|
||||
(when (modulep! +lsp)
|
||||
(add-hook! '(tex-mode-local-vars-hook
|
||||
|
Reference in New Issue
Block a user