hdima / python-syntax

Python syntax highlighting script for Vim
http://www.vim.org/scripts/script.php?script_id=790
MIT License
363 stars 109 forks source link

Unmatched/unbalanced parenthesis/brackets/etc #26

Closed andrevmatos closed 9 years ago

andrevmatos commented 9 years ago

Would be nice if you could add highlight error for unmatched and unbalanced parenthesis/square brackets/curly braces/etc. For example, marking everything after (to the end of the file) an unclosed parenthesis in a function definition, to be highlighted with red background, or everything before (to the beginning of the file) an additional closing bracket without a corresponding starting bracket, or everything inside an opening parenthesis with closing bracket (unbalanced grouping stack). That way, could be easier to identify balancing errors in big enclosed declarations, like that from big nested dicts declarations. Thanks for the great work.

hdima commented 9 years ago

I don't think I like this idea. Because it means if you for example just entered open bracket in a new file the rest of the file will be all red and you lost all the other highlighting until you enter the corresponding closing bracket.

Moreover you can also use standard to Vim showmatch (see :help showmatch) option or pi_paren (see :help pi_paren) plugin.