6853 Commits

Author SHA1 Message Date
Colomban Wendling
4ce6409e89 Remove useless utils_invert_color() 2013-12-04 15:46:05 +01:00
Colomban Wendling
8980970630 Unify color parsing
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.
2013-12-04 15:31:17 +01:00
Colomban Wendling
1590007862 Remove an unnecessary allocation 2013-12-04 14:59:05 +01:00
Colomban Wendling
3522e81d73 Merge branch 'wip/color-parsing-improvements' 2013-12-03 03:09:41 +01:00
Colomban Wendling
f07b5457d6 Simplify fold toggling code using higher-level Scintilla API 2013-12-02 23:19:44 +01:00
Colomban Wendling
3759562d7c Simplify reading highlighting colors with new utils_parse_color()
Drop redundant code converting # and short formats to hex colors now
utils_parse_color() can parse them.
2013-12-02 22:58:54 +01:00
Colomban Wendling
ebde42617a Accept colors with only 1 digit per channel in utils_parse_color()
AKA short HTML color notation.
2013-12-02 22:53:35 +01:00
Colomban Wendling
11a2f0ee91 Properly validate input in utils_parse_color() 2013-12-02 22:44:40 +01:00
Colomban Wendling
507005ca54 Rename utils_strtod() to utils_parse_color()
Rename the function to a more sensible name, and remove unnecessary
arguments.  Now, format (# or 0x) is auto-detected.
2013-12-02 22:38:11 +01:00
Colomban Wendling
f99e627bb0 Fix folding of the very last line in a level when unfolding children
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.
2013-11-23 00:45:39 +01:00
Colomban Wendling
cff36e7497 R: properly display sources and libraries in the symbol list 2013-11-20 18:41:11 +01:00
Colomban Wendling
10893c4ada R: fix invalid memory access in the tag parser 2013-11-20 18:40:22 +01:00
Colomban Wendling
1dfc1077c7 Fix crash in fallback mime icon loading code under GTK3 2013-11-18 22:22:57 +01:00
Colomban Wendling
cebc20a47c Use proper argument list 2013-11-11 18:54:08 +01:00
Colomban Wendling
bbc0fa3b69 Don't depend on an implementation detail of S_ISREG and S_ISDIR 2013-11-11 18:52:45 +01:00
Colomban Wendling
1f2279aefe Always use proper functions argument lists 2013-11-10 01:43:10 +01:00
Colomban Wendling
39fa004619 Fasten utils_tidy_path() a little and fix possible leaks in it
Fix possible leaks with bad paths, and also speed up some part of the
function by avoiding unnecessary allocations and string length
computations.
2013-11-07 23:11:15 +01:00
Colomban Wendling
c074817b8b Fix 2 unlikely memory leaks 2013-11-07 22:57:40 +01:00
Colomban Wendling
1d8dd84a47 Fix some small type issues in printf formats 2013-11-07 21:28:23 +01:00
Colomban Wendling
5c22c9d73e R has braces 2013-11-04 17:42:05 +01:00
Colomban Wendling
7b2f39a852 Remove an unused variable and plug a theoretical memory leak 2013-11-04 16:05:25 +01:00
Colomban Wendling
b2f4717ad3 Plug a memory leak on Windows 2013-11-03 23:35:55 +01:00
Colomban Wendling
5918532ab2 Explicit a valid cast 2013-11-03 22:31:00 +01:00
Colomban Wendling
cb588a1b82 Plug a possible memory leak 2013-11-03 22:30:55 +01:00
Colomban Wendling
0cb139638f Plug a memory leak 2013-11-03 22:18:50 +01:00
Colomban Wendling
bc6c345153 Remove an unused variable that could be leaked 2013-11-03 22:18:26 +01:00
Colomban Wendling
6e46cca735 Fix mismatching allocation and deallocation
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.
2013-11-03 01:52:27 +01:00
Colomban Wendling
47609ec102 Plug a possible memory leak 2013-11-03 01:52:12 +01:00
Colomban Wendling
02852b33b0 Simplify utils_get_hex_from_color() and plug a possible memory leak in it 2013-11-03 01:51:03 +01:00
Colomban Wendling
fd18b7455c Plug a possible memory leak
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.
2013-11-02 22:10:32 +01:00
Nick Treleaven
6a19a4488d Add info on how g_spawn is broken on Windows 2013-10-31 13:54:31 +00:00
Colomban Wendling
ef331759b0 If we write C99, we better make sure we compile as such 2013-10-20 15:19:56 +02:00
Matthew Brush
131b608d5b Update HACKING a bit for C99 standard 2013-10-20 05:59:21 -07:00
Colomban Wendling
7d79df7975 Merge branch 'scintilla-update-336' 2013-10-16 15:45:01 +02:00
Colomban Wendling
635b7c24a6 Update Scintilla to version 3.3.6 2013-10-16 15:36:57 +02:00
Colomban Wendling
b645eccf6e Do not ignore keys inside inherited groups
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.
2013-10-15 16:17:59 +02:00
Enrico Tröger
48fe855b50 Adjust test case tags file for fixed Python parser (class arglist assignment) 2013-10-13 18:55:16 +02:00
Enrico Tröger
3443e288fe Add flag to tm_tags_find() to indicate the tags array may not be sorted
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.
2013-10-13 18:52:56 +02:00
Nick Treleaven
a408938e95 Set group for Clojure filetype 2013-10-13 12:57:37 +01:00
Yosef Or Boczko
49056ba984 Updated Hebrew translation 2013-10-13 12:48:28 +02:00
Nick Treleaven
b3b6d4efad Fix missing warning section 2013-10-11 16:47:04 +01:00
Nick Treleaven
15fb2f321a Improve custom filetype formatting/links 2013-10-11 16:43:27 +01:00
Nick Treleaven
18d27364ac Update notes for adding a custom filetype 2013-10-11 16:43:24 +01:00
Frank Lanitz
40cd633d5f Update of Slovenian translation by Jože Klepec 2013-10-11 09:56:08 +02:00
Nick Treleaven
d51079d598 Fix mingw-gcc 'ordered comparison of pointer with integer zero' warning 2013-10-10 12:44:15 +01:00
Colomban Wendling
1ab97fe2e0 Plug a memory leak when reading misnamed tag files
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 ;)
2013-09-25 00:00:44 +02:00
Colomban Wendling
8f11c62dc9 Fix some module-specific globals not declared static
This prevents the symbol to be exported and possibly conflict with
another one.
2013-09-24 16:26:57 +02:00
Colomban Wendling
e4eacef82b Plug a memory leak
Thanks to Pavel Roschin for spotting it.
2013-09-24 16:23:48 +02:00
Colomban Wendling
af3421e688 Plug a memory leak
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.
2013-09-23 21:54:30 +02:00
Colomban Wendling
32b971cf1c JavaScript: fix parsing of regular expressions in a return statement 2013-09-23 16:52:55 +02:00