This captures the common case when e.g. changing the document outside
Geany and switching back to Geany.
Remove the osx-specific code doing the same for osx only.
The document_check_disk_status() guarantees that there's no check
performed when switching pages using Ctrl+Tab - remove the outdated
comment and idle call and perform force-check.
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.