-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Smart parentheses in ipython-notebook #5491
Comments
Looks like adding (add-hook 'ein:notebook-multilang-mode-hook 'smartparens-mode) to The second problem (closing parenthesis on one line erroneously duplicates it and closes it on the next line) seems to also be present in |
@StreakyCobra Does this have something to do with your trick? |
Unless I can indeed reproduce the Python bug when it's activated, it's related to the use of @aldanor I suppose you also have Keeping Starting with the following text (not in the last line of the file, this is a limitation of smartparens, no idea why…):
And pressing two times a closing parenthesis (
|
@StreakyCobra Indeed turning
navigate the cursor between
|
Yes I added this feature recently because it was really useful for dealing with closing parenthesis (bracket, quote, etc.) in a lot of ways. The implementation is more like a hack on top of smartparens, but it's an elegant hack (from my point of view at least, but I'm probably biased 😉) I am able to reproduce this with a minimum configuration:
So it seems to be a I don't have a lot of time these days, so I encourage you to report it upstream to |
@StreakyCobra Yea, looks like it happens in all prog modes, not just Python (e.g. fire a scratch buffer with prog-mode and the error is the same). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Description
Smart parentheses are not behaving well in
ipython-notebook
(proper modes not enabled?).Reproduction guide
SPC a i n
print()
in a new cell, observe the error; you may or may not be able to close the parenthesisThen, delete the closing parenthesis of
foo()
and type it again. You then end up with something like this:foo('bar')
. You will end up withObserved behaviour:
smartparens-mode
andsmartparens-global-mode
are enabled in Python buffers but not enabled inipython-notebook
layer. This leads to some weird behaviour when trying to close parentheses, sometimes extra parens are inserted or it won't let you close them at all. In any case, the error message is: "Search failed. This means there is an unmatched expression somewhere or we are at the beginning/end of file.", which seems to be an:unmatched-expression
error thrown insp-get-paired-expression
.Enabling
smartparens-mode
andsmartparens-global-mode
seems to fix it, but I'm not sure how it should be fixed properly.System Info
The text was updated successfully, but these errors were encountered: