[wingide-users] Auto-close characters should not produce non-pythonic code

Luc Bourhis luc_j_bourhis at mac.com
Wed Mar 20 08:11:00 EDT 2013


Hi,

consider the following code

expr = re.compile(r"let | set", re.X)

In order to put parenthesis around "let", I would like to proceed as follow:
1. put the cursor just before "l"
2. type "("
3. jump to the position after "t"
4. type ")"

Wing 4.1.12 does not let me do it because at step (2) it auto-closes the parenthesis resulting in

expr = re.compile(r"()let | set, re.X)

Thus I have to waste time deleting the closing parenthesis before moving to step (3). This is a universal behaviour as Wing does the same if instead

expr = a + b*c

and I wanted to put "a+b" between parenthesis by first typing "(" before "a". This is also universally un-pythonic as "()a" almost never leads to valid Python code (the only exception being string formatting "%(name)s" really).

Thus could we have a rule that typing "(" never auto-closes with ")" if there is a character immediately to the right other than a space?

Best wishes,

Luc J. Bourhis




More information about the wingide-users mailing list