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

show-smartparens-mode not working when cursor on right parenthesis #758

Closed
et2010 opened this issue Jun 19, 2017 · 9 comments
Closed

show-smartparens-mode not working when cursor on right parenthesis #758

et2010 opened this issue Jun 19, 2017 · 9 comments
Assignees

Comments

@et2010
Copy link

et2010 commented Jun 19, 2017

Expected behavior

Left matching parenthesis should be highlighted when the cursor is on the right parenthesis.

Actual behavior

Left parenthesis is not highlighted, see the fig below:

image

Note that when the cursor is on the left parenthesis, the highlighting works as expected:

image

Steps to reproduce the problem

Just open any elisp buffer and move the cursor as described above. Make sure the built-in show-paren-mode is off.

Edit: I'm using evil-mode, above repro guide is for the 'normal' state. For emacs state, to reproduce, you should move the cursor to the point before the right parenthesis.

Environment & version information

  • smartparens version: smartparens-20170618.744
  • Active major-mode: emacs-lisp-mode
  • Emacs version (M-x emacs-version): GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.10) of 2017-04-22
  • OS: Archlinux
@Fuco1
Copy link
Owner

Fuco1 commented Jun 19, 2017

Try to set sp-show-pair-from-inside to t.

The problem is that vim and emacs handle the point differently. In vim cursor is on the character while in emacs cursor is between characters, so even if it actually draws on top it is in reality between that and the previous char.

We only highlight the pair backwards if the closing delimiter is the previous character.

@et2010
Copy link
Author

et2010 commented Jun 19, 2017

Thanks for clarifying. I still observed the same behavior after setting sp-show-pair-from-inside to t. Restarting emacs after setting the variable didn't work either.

@et2010
Copy link
Author

et2010 commented Jun 21, 2017

It seems that setting sp-show-pair-from-inside to t doesn't work anymore, is it a bug or just me? @Fuco1

@dieggsy
Copy link
Contributor

dieggsy commented Jun 21, 2017

Same issue here - to clarify, this is only an issue in normal mode, works fine in insert mode. @Fuco1 would it be possible to add a (when featurep 'evil) or similar that checks if in evil-normal-state and changes the behavior for the closing delimiter?

@Fuco1
Copy link
Owner

Fuco1 commented Jun 21, 2017

We have that already

(and (or (sp--evil-normal-state-p)
         (sp--evil-motion-state-p)
         (sp--evil-visual-state-p))
     (sp--looking-at (sp--get-allowed-regexp)))

There's probably some other issue /shrug

@Fuco1
Copy link
Owner

Fuco1 commented Jun 23, 2017

I have tried this just now with the latest evil from melpa, latest smartparens on emacs 25.2.1 and I can not reproduce the problem. I have the exact same text as on the screenshot and it highlights as expected

Can you try this without spacemacs, just with evil mode and smartparens loaded?

/cc @agzam

@et2010
Copy link
Author

et2010 commented Jun 24, 2017

I tried stock emacs with only evil and smartparens loaded, but the issue persists:

sp

Make sure you turn off show-paren-mode before trying to reproduce.

@Fuco1 Fuco1 closed this as completed in 0f32a87 Jun 24, 2017
@Fuco1
Copy link
Owner

Fuco1 commented Jun 24, 2017

Should be fixed in master.

@et2010
Copy link
Author

et2010 commented Jun 24, 2017

Thanks!

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

No branches or pull requests

3 participants