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

Wrong behavior in C-like modes (at least with default configuration) #1166

Open
doublep opened this issue Jul 7, 2023 · 0 comments
Open

Comments

@doublep
Copy link

doublep commented Jul 7, 2023

Default behavior of sp-forward-slurp-sexp and related functions in C-like modes is wrong, at least unless you apply special configuration to fix it. In comparison, everything works correctly out-of-the-box if you open a JavaScript file, despite JS having a pretty C-like or Java-like syntax.

Steps to reproduce the problem

Open a file with text

foo.bar (42);

in a C-like mode (extensions .c, .cpp, .java and likely others associated with C-like modes).

Type ( then M-x sp-forward-slurp-sexp RET several times (or whatever keybinding you use for that).

Expected behavior

After (:

()foo.bar (42);

After consecutive slurping:

(foo).bar (42);
(foo.bar) (42);
(foo.bar (42));

Actual behavior

()foo.bar (42);     // As expected
(foo.)bar (42);     // Wrong
(foo.bar) (42);     // As expected
(foo.bar (42);)     // Wrong

Environment & version information

  • smartparens version: Git checkout at 79a338d
  • Active major-mode: c++-mode
  • Smartparens strict mode: nil
  • Emacs version (M-x emacs-version): GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.33, cairo version 1.16.0) of 2023-04-08
  • Starterkit/Distribution: none
  • OS: gnu/linux
@Fuco1 Fuco1 added this to Triage Mar 18, 2024
@Fuco1 Fuco1 moved this to To triage in Triage Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To triage
Development

No branches or pull requests

1 participant