gp1313 / iep

Automatically exported from code.google.com/p/iep
0 stars 0 forks source link

Detection of single brackets and quotes #176

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Suggest IEP detect and highlight incomplete parentheses, brackets and quotation 
marks (let's call them just "marks" from here onwards).

- When entering a mark one of two implementation options is possible:
1. Opening mark is highlighted from the moment of being entered (or: from the 
moment the *next* character is entered) until a closing mark is entered.
2. When entering a mark a pair is entered automatically - an opening mark 
before the cursor and a closing mark after the cursor. Some implementations 
highlight the entered marks momentarily (flicker, actually) to signal that a 
pair of marks has been inserted instead of a single mark.

- When deleting an ending mark, must highlight the opening mark as per option 
No. 1.
- Must recognise nested brackets and parenthesis, always highlighting the 
outermost ones.

I personally prefer the first option, but I guess a setting can be made for the 
second option as well, for those who prefer it.

Suggest checking the PyScripter implementation of this feature to get an idea 
of how the different options function: 
https://code.google.com/p/pyscripter/downloads/detail?name=PyScripter-v2.5.3.zip
&can=2&q=

Original issue reported on code.google.com by zaha...@gmail.com on 4 Mar 2013 at 10:38

GoogleCodeExporter commented 8 years ago
"Must recognise nested brackets and parenthesis, always highlighting the 
outermost ones." - referring to incomplete parentheses. For example: In this 
statement only the first parenth - the one following "str" - will be 
highlighted: "str(round(variable.method())"

Some implementations also highlight the innermost parenths the cursor is in, so 
for example if I have this complete statement:
"str(round(variable.method()))"
If the cursor is between the letters of the word "variable", than the second 
pair of parenths (and only this pair) will be highlighted.

Original comment by zaha...@gmail.com on 4 Mar 2013 at 10:45

GoogleCodeExporter commented 8 years ago
Single quotation marks are already detected. In this case the string has a 
stippled underline.

Original comment by almar.klein@gmail.com on 5 Mar 2013 at 9:25

GoogleCodeExporter commented 8 years ago
This is what you get for doing a search for brackets, parenths, parenthesis, 
parentheses, autocompletion, quotes and marks - braces!

Original comment by zaha...@gmail.com on 5 Mar 2013 at 11:14

GoogleCodeExporter commented 8 years ago
Also - I think the underline is too subtle for this task. Highlighting/bolding 
is better in my opinion.

Original comment by zaha...@gmail.com on 5 Mar 2013 at 11:15

GoogleCodeExporter commented 8 years ago
That is subject to personal preference :)  I think that making the highlighting 
too strong it may be annoying when writing a string (in which case you have an 
invalid string for a while).

You can always change the style yourself. For now you'll have to edit 
codeeditor/base.py, but in the future this should be easier to do.

Original comment by almar.klein@gmail.com on 5 Mar 2013 at 1:31