Blender Git Loki

Git Commits -> Revision c0898bb

Revision c0898bb by Campbell Barton (master)
July 26, 2010, 18:38 (GMT)
[#23032] Bracket Highlighting in Text Space Fix [Patch to fix attached]
from Justin Dailey (dail)

from the tracker
--- snip ---

In the text editor doing something like this:

print(":(")

When it goes to match the closing bracket, it will highlight the one in the string, not the first one. Also doing:

array["[index"]

will cause it to match the second [ with the closing one.

I have attached a patch to fix this issue. (See attached image to see correct highlighting)
It also works with triple quotes strings(ie """...""" or '''...''')

*Note* However, originally bracket highlighting always on even if syntax highlighting is off. The patch makes it so
it only highlights brackets when syntax highlighting is on (this is a side effect of doing the code this way, if it
was done any other way ALOT of code would have been needed to check for strings,triple quoted strings, escaped quotes,
and comments forwards and backwards). When highlighting matching brackets, the code checks the line's format string
to see if the char is in a string or comment to skip it. If syntax highlighting is turned off, the format string is
null and cannot be used,thus no bracket highlighting.

Commit Details:

Full Hash: c0898bbf48ecf7c9260489d93c37f6f4fbd7b71d
SVN Revision: 30764
Parent Commit: 8fb499c
Lines Changed: +30, -21

1 Modified Path:

/source/blender/editors/space_text/text_draw.c (+30, -21) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021