Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org-mode: code marker should prevent nested pairs #1031

Closed
asymmetric opened this issue May 7, 2020 · 3 comments
Closed

org-mode: code marker should prevent nested pairs #1031

asymmetric opened this issue May 7, 2020 · 3 comments

Comments

@asymmetric
Copy link

asymmetric commented May 7, 2020

Expected behavior

~0200::/|~ should stay how it is.

Actual behavior

~0200::/|/~, i.e. a closing / is added, which doesn't make sense in org-mode, as it's not possible to italicize text within ~code markers~.

Steps to reproduce the problem

Backtraces if necessary (M-x toggle-debug-on-error)

Environment & version information

  • smartparens version:
  • Active major-mode: org-mode
  • Smartparens strict mode: nil
  • Emacs version (M-x emacs-version): GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
  • Starterkit/Distribution: Doom
  • OS: gnu/linux
@Fuco1 Fuco1 closed this as completed in ce1b3b9 Mar 17, 2024
@Fuco1
Copy link
Owner

Fuco1 commented Mar 17, 2024

Thanks, this is a good suggestion. I added it to the default org config.

@jaccarmac
Copy link

The fix seems to cause massive input lag in a large Org file I have. I don't have minimal reproduction case yet, but there seems to be some interaction with single-quotes used as apostrophes in prose. It's not as simple as every such quote slowing down or speeding up text entry, but if I position my cursor after a certain quote near the end of the file, input is slow before said quote and normal afterwards. Calling sp-backward-sexp while positioned near a quote jumps to the preceding Org heading or, if there's an inline code block in the way, the beginning of that.

I may be doing something or have some garbage in the file to cause the pathological behavior, but since rolling back the single commit fixed things I'm dropping this note in under-debugged form.

@Fuco1
Copy link
Owner

Fuco1 commented Mar 20, 2024

That is very well possible. I will try to add an optimization which is going to be usefull in general to limit "string" pairs to the current subtree, because they can't span out of a tree in org mode anyhow. Might also want to stop the search on block boundaries and fixed width (line prefixed with :).

This is not exactly cause of your issue, but I believe it will fix it and make everything faster as well. I'll ping you when I have a fix if you would be willing to test it :)

I will track this in a new issue #1192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants