fix(data): correct XML closing tag insertion

`nxml-slash-auto-complete-flag` inserts the rest of the closing tag when
`</` is inserted, but smartparens also defines `(sp-local-pair "<" ">")`
for `sp--html-modes`, so two `>` are inserted for closing tags. Apply
the upstream developer’s suggested fix.

Fix: https://github.com/doomemacs/doomemacs/issues/6331
Ref: https://github.com/Fuco1/smartparens/issues/397
This commit is contained in:
Liam Hupfer 2023-09-27 00:18:32 -05:00 committed by Henrik Lissner
parent 2497d58e9a
commit 1e1e6150d8

View file

@ -7,6 +7,9 @@
:config :config
(setq nxml-slash-auto-complete-flag t (setq nxml-slash-auto-complete-flag t
nxml-auto-insert-xml-declaration-flag t) nxml-auto-insert-xml-declaration-flag t)
;; https://github.com/Fuco1/smartparens/issues/397#issuecomment-501059014
(after! smartparens
(sp-local-pair 'nxml-mode "<" ">" :post-handlers '(("[d1]" "/"))))
(set-company-backend! 'nxml-mode '(company-nxml company-yasnippet)) (set-company-backend! 'nxml-mode '(company-nxml company-yasnippet))
(setq-hook! 'nxml-mode-hook tab-width nxml-child-indent) (setq-hook! 'nxml-mode-hook tab-width nxml-child-indent)
(set-formatter! 'xmllint '("xmllint" "--format" "-") :modes '(nxml-mode))) (set-formatter! 'xmllint '("xmllint" "--format" "-") :modes '(nxml-mode)))