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.
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.
In the preferences dialog it would show a single
quote because the print command couldn't be found
and the NULL prematurely terminated the g_strconcat()
call, leaving a single quote in the print command
entry.
Thanks to Lex for finding where the problem was.
Windows PowerShell is a command-line shell and associated scripting language
which comes out of the box with Windows 7/Server 2008/8/Server 2012.
Original lexer from Scintilla is used.
* Uses existing LexOthers.cxx from Scintilla already in use by Geany
* "identifier" style mapping goes to "string" for better presentation
even if it's semantically incorrect, we'll change it back if it causes
issues for anyone.
* Filetype configuration and keywords taken from Don Ho's Notepad++.
Closes#160
When using the document close keybinding, it is legitimate for the
callback to be called even if there are no documents open, so properly
check for this.
Closes [bugs:#941]
Use g_set_error() instead of doing it manually and forgetting to check
whether the pointer is NULL or not before dereferencing it.
Spotted by clang --analyze.
C-style multiline comments, used among others in C, C++ and Java, are
often continued on next lines with an additional space followed by an
asterisk:
1. /* first comment line
2. * continuation line (asterisk is aligned with previous line)
3. * last line */
This fools the indentation with detection because lines 2 and 3 from
the above example have an extra space in what is considered being the
line indentation. In this example, the algorithm would detect an
indentation width of 5 rather than 4, because here most lines have an
indent of 5 -- although they actually have an indent of 4 plus a space
for alignment. This is not a problem in most situations because there
generally are fewer comment continuation lines than actual code lines
which have a indent multiple of the actual indent width, but with some
code with a lot of comments (e.g. short functions with verbose
documentation comments) this might start to fool the algorithm and
give wrong, annoying, results.
So, try to detect these continuation lines and avoid taking them into
account.
When scrolling the keybinding list to display a particular row, which
is used to display a particular plugin's keybindings, consistently
scroll so the row is on the top left. This makes it easier to see the
row in question since it's always at the same location, and it shows
more child keybindings.
Remove most obvious calls to our very own deprecated Scintilla wrapper
functions sci_get_text(), sci_get_text_range() and
sci_get_selected_text().
Some calls are still left, but they either really benefit from these
functions or the fix would be more complex.