It may happen (and happens on OS X) that plugin activation using
plugin_new() triggers some action which causes the tree view to
update. However, as the old plugin was freed before, the tree view
contains an invalid pointer to p which causes invalid memory access.
After freeing the old pointer, set the tree view value to NULL - the
plugin pointer is checked at other places for NULL value so it
doesn't crash.
Now that there is a proper user indication for the "maintain history on
reload" feature we can toggle it on by default. The setting is also renamed
so that the default is effective for everyone (this was the plan).
6f5d5db and d6d4728 disabled "maintain history on reload" by default,
with the intention to reenable it when we have a better method to
make it discoverable for the user. This was necessary since it became
enabled by default but could be surprising given Geany warned about
losing data before.
This commit tries to resolve the discoverability, by providing an
informational doc message that is shown once to the user, after the first
reload. The doc message also gives the option to disable this feature.
configdir is initially in locale (glib) encoding. Converting it from
UTF-8 is wrong, and it must be converted _to_ UTF-8 when used in
geany_debug() - otherwise, Help -> Debug Messages fails assertion.
POSIX only, under Windows the glib encoding is also UTF-8.
Closes#658.
Drop the loop in mem_read() in favor of a single memcpy() call.
This greatly improves performances when nmemb > 1, for a small loss
for some values of size when nmemb == 1. Gain can theoretically be
infinite since swapping nmemb and size parameters changes almost
nothing while it had a dramatic performance impact previously. Loss
is up to about 25% in the worst case for some values of size when
nmemb is 1.
Also, now the function always copies as much data as possible, not only
whole blocks. This follows the glibc implementation of fread() and
simplifies the code. Doing so also fixes the position after a partial
read to be at the last readable character rather than the end of the
last read block.
In particular, the exec() and CreateProcess() errors are reported
directly, but failures in other any functions, which are extremely
rare, include some descriptive text, such as "Failed to set pipe
handle to inheritable (Access denied)". The example is artificial.
That is, do not cite the original text, program name, or the failed
OS function name (except when the testing program is compiled).
Also cut glib citing of the original text on bad quoting.
Fix handling of scopes starting with a non-ASCII character.
Actually, just drop the check on the first byte of the scope, as it
doesn't seem to serve any purpose as it only checks the first byte (so
isn't any kind of real validation; and as it predates Geany it's
impossible to know the real reason behind this check), and breaks
support for non-ASCII scopes.