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

sp-backward-symbol does not skip over comment in Erlang code. #1103

Open
pierre-rouleau opened this issue Sep 21, 2021 · 2 comments
Open

sp-backward-symbol does not skip over comment in Erlang code. #1103

pierre-rouleau opened this issue Sep 21, 2021 · 2 comments

Comments

@pierre-rouleau
Copy link

pierre-rouleau commented Sep 21, 2021

Expected behavior

With located at position marked by ∎ in following Erlang code in erlang-mode buffer:

start_app(App) ->                 % first clause                                                                           start_app(App, temporary).

Executing M-x sp-backward-symbol should move point to the beginning of previous symbol, which happens to be App:

start_app(∎App) ->                 % first clause                                                                           
    start_app(App, temporary).

Actual behavior

Instead it lands right inside the comment:

start_app(App) ->                 % first ∎clause                                                                           
    start_app(App, temporary).

Note:

  • sp-skip-forward-to-symbol skips over comments.
  • sp-forward-symbol also stops within comments.
  • I would expect to see both sp-forward-symbol and sp-backward-symbol to skip comments.

Steps to reproduce the problem

  • Open an Erlang file, type the following code, activate smartparens-mode and do what's in the example above.

Environment & version information

  • smartparens version: 20210529.1129. Also tested on version 20210904.1621 with same results.
  • Active major-mode: erlang-mode
  • Smartparens strict mode: nil
  • Emacs version (M-x emacs-version): GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.6.0) of 2019-08-30
  • Starterkit/Distribution: Vanilla
  • OS: darwin
@pierre-rouleau
Copy link
Author

I looked at the code and both sp-forward-symbol and sp-backward-symbol do no skip comment. I beleive they should (or at least have a user-option that would control the behaviour). I will submit a PR to skip the comments.

@pierre-rouleau
Copy link
Author

PR submitted.

@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