smartparens
smartparens copied to clipboard
sp-forward-barf-sexp edge case in org mode
Expected behavior
In org mode, with two words in a pair and cursor inside (indicated as ^ in example)
The quick *^brown fox* jumps over the lazy dog.
running sp-forward-barf-sexp should result in
The quick *^brown* fox jumps over the lazy dog.
Actual behavior
Running sp-forward-barf-sexp effectively acts twice, and results in
The quick *^*brown fox jumps over the lazy dog.
This works as expected with more than two words enclosed in the pair, and works for the backward and slurp variants without any issue that I saw. The edge case doesn't exist two words and a not-org-specific pair like (). Also, this bug doesn't seem to happen in other modes (I tried text-mode and python-mode)
Perhaps related?
It does seem that for some pairs in other modes, an empty pair can slurp. That's true for () and "" in python-mode, true for () but not true for `` in text-mode… Anyway, it doesn't seem to be true for pairs in org, an empty org-specific pair cannot slurp.
Environment & version information
smartparensversion: 20200203.1757- Org mode version: 9.3.4 / org-20200206
- Active
major-mode:org-mode - Smartparens strict mode: nil
- Using
(smartparens-global-mode t) - Emacs version (
M-x emacs-version): GNU Emacs 26.2 - OS: gnu/linux
Seems like the slurping works but only in a specific case as well
The quick *|* brown fox jumps over the lazy dog.
calling forward slurp there captures brown but does not continue further.
What you describe with the barf is definitely a bug though.