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 auto-insert problem #1193

Closed
spyder-bot opened this issue Feb 17, 2015 · 5 comments
Closed

Parentheses auto-insert problem #1193

spyder-bot opened this issue Feb 17, 2015 · 5 comments

Comments

@spyder-bot
Copy link
Collaborator

From dregit...@calystabio.com on 2012-11-15T17:32:08Z

Spyder Version: 2.1.9
Python Version: 2.7.3
Qt Version: 4.8.0, PyQt4 (API v1) 4.9.1 on Windows

What steps will reproduce the problem?

  1. Ensure that automatic parentheses insertion is on.
    1. Type "test(a)" (without quotes). Auto-insertion works as expected.
    2. Imagine we want to cast "a" to an int... type "int(" before a. No auto-insertion occurs, because the editor can't know where you want the parenthesis.
    3. Now move over to close the parentheses, and type ")" after a. No closing paren is actually inserted - auto-insert overwrites the one you had there from before. What is the expected output? What do you see instead? Ideally, you'd want that last paren to actually insert, rather than overwriting your old one. I imagine auto-insert has this overwrite behavior in case you type the close-paren after it has auto-inserted one, so you don't end up with two. That's expected, but this same overwrite behavior isn't expected when the closing paren was never auto-inserted to begin with. Of course this is complicated by the fact that the close paren here was auto-inserted, just so long ago that it's no longer relevant. Maybe something can trigger a paren to no longer be considered overwritable?

This isn't really urgent, but it's certainly annoying. I turned off auto-insert for now to avoid it, since it often causes syntax errors when I'm working with nested parentheses.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1193

@spyder-bot
Copy link
Collaborator Author

From contrebasse on 2012-11-20T00:20:36Z

Maybe the closing parenthesis should not be overwritten if a SyntaxError is detected on the line ?

@spyder-bot
Copy link
Collaborator Author

From lucianoe...@gmail.com on 2014-09-15T11:25:12Z

I'm also having an issue with auto-inserting of parentheses, which I believe might be related--when I type a closing parentheses in front of an auto-inserted one, it never notices, and I end up with an extra closing parentheses. This does not happen with brackets:

I type:
foo[
and this appears:
foo[]
then I type ']', and I get:
foo[]
with the cursor now to the right of the final ']'.

In contrast, I type:

foo(
and this appears:
foo()
and then I type ')' and get:
foo())
with the cursor in between the two close-parens.

If this is actually a separate issue, I'm happy to open a different report. Thanks!

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-09-16T12:35:46Z

Labels: Cat-Editor MS-v2.4

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-09-16T12:36:07Z

We'll see what we can do about it in our next version

@ccordoba12 ccordoba12 modified the milestones: v3.1, v3.0 Dec 16, 2015
@CAM-Gerlach
Copy link
Member

Duplicate of #5588 , which was fixed in Spyder 3.2.5.

@ccordoba12 ccordoba12 removed this from the todo milestone Mar 17, 2018
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