smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Incorrect handling of unmatched pairs in comments

Open bbukh opened this issue 5 years ago • 0 comments

Expected behavior

The pairs (unmatched or matched) in comments should not affect matching pairs in the code.

Steps to reproduce the problem

Enter the following LaTeX code

% Some text with unpaired dollar sign $
$x^2$

put the point at the first dollar-sign and call sp-wrap-with-pair '(' (bound to some key). I expect $x^2$ to turn into ($x^2$), but instead I obtain

% Some text with unpaired dollar sign ($
$)x^2$

As a workaround, I figured out that one can use narrow-to-region to narrow to a current paragraph before invoking sp-wrap-with-pair and then widen to set it back. However, it would still be nice to have it fixed.

Environment & version information

  • smartparens version: 20200324.2147
  • Active major-mode: latex-mode
  • Smartparens strict mode: nil
  • Emacs version (M-x emacs-version): GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2015-03-07 on trouble, modified by Debian
  • Starterkit/Distribution: Debian
  • OS: gnu/linux

Thanks a lot for a great tool!

bbukh avatar May 15 '20 22:05 bbukh