Fuco1 / smartparens

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.
GNU General Public License v3.0
1.82k stars 195 forks source link

sp-end-sexp and sp-beginning-sexp unexpected behavior #859

Closed richarddwang closed 6 months ago

richarddwang commented 6 years ago
(save-excursion
    ;; If right-char when can't the function will stop
    (if (not (eobp)) (right-char))
    (funcall prev)
    (if (= position (point)) (setq at-beginning t)))

When cursor is at anywhere on save-excursion

Expected behavior

Move cursor to the position between ( and save-excursion after sp-beginning-sexp Move cursor to the end like t))|) after sp-end-sexp

Actual behavior

Won't move a bit after sp-end-sexp or sp-beggining-sexp

Environment & version information

smartparens version: 20180204.844

Fuco1 commented 6 years ago

I'm assuming you mean sp-end-of-sexp and sp-beginning-of-sexp. I've tried but can't reproduce this issue.

Can you try this in an emacs -q session (this won't load your config). You will have to manually load dash and smartparens first because your packages won't initialize either.

Fuco1 commented 6 years ago

Can you please check if this is fixed with the patch fixing #860? I can't reproduce this particular case.

richarddwang commented 6 years ago

I have leaved a comment on #860 . "I use smartparens20180308.1042 now, but I still get the same issue. And I can still use the way specified by issue mentioned in my comment above, to reproduce and to avoid the issue."

Fuco1 commented 6 months ago

There are no functions sp-end-sexp or sp-beggining-sexp, maybe they come from another package and don't work. I tried to reproduce the issue with the original buffer posted, calling sp-end-of-sexp and sp-beginning-of-sexp and they work as intended.