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

parentheses highlighting inconsistent on closing parentheses #2823

Closed
darkfeline opened this issue Aug 29, 2015 · 11 comments
Closed

parentheses highlighting inconsistent on closing parentheses #2823

darkfeline opened this issue Aug 29, 2015 · 11 comments

Comments

@darkfeline
Copy link
Contributor

show-smartparens-mode behavior is inconsistent on closing parens.

On opening parens:

*    *
((()))
^

When the cursor is at the caret, the two starred parens are highlighted, but for closing parens it does this:

 *  *
((()))
     ^

The fix is to set sp-show-pair-from-inside to t:

*    *
((()))
     ^
@TheBB
Copy link
Collaborator

TheBB commented Aug 30, 2015

Maybe you can PR this?

@sooheon
Copy link

sooheon commented Aug 30, 2015

This was a conscious decision, related to the change with evil-move-beyond-eol (439278b) . I think syl20bnr's decision was to simply adhere a bit closer to the emacs idea of cursor location, which is important for evaluating sexps.

While it may be unnatural when you move between parens by %, it is completely natural and correct if you use paredit/smartparens/lispy commands to move by sexps. In other words, it's not really a bug, but there is room for personal taste and I think a documented toggle may be needed.

@darkfeline
Copy link
Contributor Author

Derp, this is basically a variant on the other issue I made: #2525

I don't know what, if anything, should be done for this. Maybe spacemacs needs a toggle that sets up everything properly depending on whether evil-move-beyond-eol behavior is wanted or not?

@sooheon
Copy link

sooheon commented Aug 31, 2015

I think this paren highlighting behaviour is already dependant on evil-move-beyond-eol, so theoretically simply setting that to nil should take care of both issues.

@TheBB
Copy link
Collaborator

TheBB commented Aug 31, 2015

The user still has to set both, because there's no user code that runs between (setq evil-move-beyond-eol nil) in init-evil and (setq sp-show-pair-from-inside (not evil-move-beyond-eol)) in init-smartparens.

@syl20bnr Since additional packages have dotfile as their owner, maybe we could support things like dotfile/post-init-xxx? I admit I don't have a ton of use cases for such a feature, but maybe it wouldn't be so hard to get it to work, if the dotfile is already "almost a layer."

@syl20bnr
Copy link
Owner

@TheBB I believe that dotfile/post-init-xxx should work out of the box :-)

What I would like in Spacemacs is the alternative fix: the parens behind the cursor block should be always highlighted. It is better for dealing with lisps and I feel that sane natural defaults in Spacemacs should go towards lisps as Emacs is the host.
For now this is a mix of the two approaches and it sucks...

We should have a setting in Spacemacs to choose to highlight current or previous pair, with a default setup to previous.

It may require some PR for smartparens/evil (I don't know exactly where is the inconsistency - if there is one).

@syl20bnr
Copy link
Owner

For the evil-move-beyond-eol issue, I think we can get best of both worlds, I'll look into evil to propose a PR to have consistent $ and x even with evil-move-beyond-eol set to t.

@TheBB
Copy link
Collaborator

TheBB commented Aug 31, 2015

@TheBB I believe that dotfile/post-init-xxx should work out of the box :-)

I confess I didn't actually try, but that's not what I see. It's off topic for this issue though, so I can look at it later.

@syl20bnr
Copy link
Owner

(@TheBB indeed, doftile owner is a special case: https://github.com/syl20bnr/spacemacs/blob/develop/core/core-configuration-layer.el#L723-L726 should be trivial to add support for an optional init function)

@syl20bnr
Copy link
Owner

This is a pretty old report, @darkfeline do you still have this behavior ?

@darkfeline
Copy link
Contributor Author

Nope, it's fixed for me.

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

4 participants