Add angle brackets to matching brackets highlighting

Review Request #130146 - Created June 5, 2017 and updated

Information
Jakub Gargul
ktexteditor
Reviewers
kate, kdeframeworks

Highlighting matching angle brackets is useful, especially when multiple of them are nested (take c++ templates for example). The only quirk is that inequality signs most of the time aren't used as brackets and irrelevant portions of texts can be highlighted.

Compiled, turned animation and bracket range highlighting on and off, checked on file with lots of nested brackets.

Jakub Gargul
Review request changed

Description:

~  

Highlighting matching angle brackets is useful, especially when multiple of them are nested (take c++ templates for example).

  ~

Highlighting matching angle brackets is useful, especially when multiple of them are nested (take c++ templates for example). The only quirk is that inequality signs most of the time aren't used as brackets and irrelevant portions of texts can be highlighted.

Aleix Pol Gonzalez

I can see how this could be useful, but then it can be weird when '<' is used as less-than.

  1. Indeed, this patch is problematic, since < and > is very often not balanced. As Aleix noted, this is the case for less than and greater than operations comparisons in programming languages, or the << and >> shift operators. The result in these cases would be more distracting than useful...

    The proper fix would be add a KTextEditor interface with API to do this animation, then KDevelop or Kile could use this API and trigger these animations correctly.

    That said, I'm not in favor of this patch, but thanks anyways!

    If you have other ideas how to solve this problem, please shoot :-)

Loading...