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-kill-region throwing Unbalanced region error on all modes #775

Closed
nayefc opened this issue Jul 17, 2017 · 3 comments
Closed

sp-kill-region throwing Unbalanced region error on all modes #775

nayefc opened this issue Jul 17, 2017 · 3 comments
Labels

Comments

@nayefc
Copy link

nayefc commented Jul 17, 2017

I upgraded smartparens this morning to the latest version and now it's throwing Unbalanced region error when I try to delete a region using sp-kill-region. I can reproduce this in python
mode and C++ mode.

I cannot seem to figure out what exactly causes this but it seems to mostly happen whenever the region contains a delimiter. For example in python, when I a file with:

x = 1

with a new line at the end, I can select the line and delete it. But when I select the new line as well, it says Unbalanced region. I can replicate this pretty consistently.

In C++, this manifests with newline along with the ; delimiter. So this region when selected cannot be deleted:

int x = y;

but not selecting the ; will allow you to kill it. This is a pretty bad bug since new lines and ; are not paired delimiters and should be deleted. I'm not sure what other characters are causing this.

If this can't be fixed soon, is it possible to roll back to an older version using melpa? This makes smartparens unusable and I rely heavily on it. Thanks!

Expected behavior

To be able to kill-region.

Actual behavior

Throws Unbalanced region error.

Steps to reproduce the problem

See above.

Backtraces if necessary (M-x toggle-debug-on-error)

I turned this on but nothing happens apart from the Unbalanced region error message.

Environment & version information

  • smartparens version: latest (20170716.1328)
  • Active major-mode: python, c++
  • Emacs version (M-x emacs-version):
  • Spacemacs/Evil/Other starterkit (specify which)/Vanilla: Vanilla
  • OS: Mac OS Sierra 10.12.5
@Fuco1
Copy link
Owner

Fuco1 commented Jul 17, 2017

Melpa does not serve more than one version, it has been discussed a lot and there is some plan to change it, but it will most likely never get implemented because nobody cares that much (well, I do but I don't have the capacity, just as the other contributors I suppose).

I would very much recommend to use melpa stable at least for smartparens. We have tests and our coverage is very very good concerning the scope of the project but sometimes things slip by. The error you are experiencing most likely originated from the patch I've submitted yesterday :/

@Fuco1 Fuco1 added the bug label Jul 17, 2017
@Fuco1 Fuco1 closed this as completed in 4899d80 Jul 18, 2017
@Fuco1
Copy link
Owner

Fuco1 commented Jul 18, 2017

I have a patch for the cases you've reported so I'm closing this issue. If you find more broken cases please report back! Thanks for your feedback, it came pretty damn fast so hopefully not many people were affected.

@nayefc
Copy link
Author

nayefc commented Jul 18, 2017

@Fuco1 awesome thanks! I'll verify once I see it on melpa.

I've switched smartparens to melpa-stable meanwhile though.

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

No branches or pull requests

2 participants