smartparens
smartparens copied to clipboard
`:wrap` does not respect `:when`-condition
Expected behavior
After defining two sp-pairs with the same :wrap
and trigger
but different parens-pairs and disjunct :when
condititions, the :wrap
keybinding inserts that pair whose :when
condition returns t
.
Actual behavior
The :wrap
keybinding always inserts that parens-pair which was defined last.
Steps to reproduce the problem
To your config, add
(sp-pair "\\textit\{" "\}"
:when '(sp-in-string-p)
:trigger "ital "
:wrap "C-S-k")
(sp-pair "\\mathit\{" "\}"
:when '(sp-in-math-p)
:trigger "ital "
:wrap "C-S-k")
- Open an org-file.
- Select some text wrapped in dollars signs and press
C-S-k
. - Select some plain text and press
C-S-k
. - Observe that in both cases, the pair "\mathit{" "}" is inserted.
This problem is OS- and version-indepdendent.