smartparens
smartparens copied to clipboard
sp-backward-symbol does not skip over comment in Erlang code.
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-symbolskips over comments.sp-forward-symbolalso stops within comments.- I would expect to see both
sp-forward-symbolandsp-backward-symbolto 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
smartparensversion: 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
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.
PR submitted.