Change utils_parse_color() to use gdk_color_parse() and follow its
syntax, additionally supporting our "0x" prefix as a synonym for the
"#" prefix; and use this everywhere.
Also add utils_color_to_bgr() and utils_parse_color_to_bgr() to provide
conversion to the 24 bits BGR format used by Scintilla.
Fix an off-by-one mistake resulting on the very last line of a nested
folded level not to be unfolded when recursively unfolding it's parent.
This was only visible when the last fold point was only one line long,
otherwise unfolding the (N-1)th line was enough.
Closes#1007.
When allocation with g_malloc(), the memory should be freed using
g_free(), not plain free().
Also, use g_try_malloc() instead of g_malloc() where the code carefully
handles allocation failures itself.
There is no need to check doc->real_path since the usage is NULL-safe,
and if it actually is empty or NULL it isn't a bug in the caller itself
anyway, and this could leak.
When inheriting a group in a filetypes file, do not ignore local keys.
This allows for partial overrides of the parent group, like:
[settings=Parent]
key=value
All keys from Parent's group "settings" would be imported, but now the
"key" key wouldn't be ignored anymore and would override a "key" key
from the group copied from Parent if it exists.
tm_tags_find() relies on a sorted tags array to be passed in but in
tm_source_file_set_tag_arglist() we don't have a sorted array yet and
sorting it on demand seems more heavy than the alternative:
make tm_tags_find() search the array linear if the new flag is set.
This fixes a bug in the Python parser when assigning the argument list
of __init__() methods to their class' argument list which annoyed me
for years already.
Also add a test case for this.
Don't leak the file name if we can't determine to which filetype it
belongs. Thanks to Pavel Roschin for spotting this.
Also, remove an useless second function indirection that simply made
the code harder to understand. This will make Matthew happy ;)
Do not evaluate a macro argument multiple times if it gets passed an
expression, especially if that expression allocates memory.
Thanks to Pavel Roschin for spotting the leak.