Watch the lifetime of objects referenced in plugin->signal_ids and
remove our references to them if they get destroyed. This avoids
possibly trying to disconnect signals on destroyed objects when the
plugin is unloaded.
Supporting this case is safer, and is useful for objects that may or
may not outlive the plugin (like ScintillaObjects), because in such
cases plugin_signal_connect() is handy to make sure the signals are
disconnected if the object is still alive, but used to crash if the
object was destroyed.
When quitting, we still have to destroy the Scintilla widget to avoid
any possibility for us to receive signals from it after we destroyed
the associated editor and/or document (used in signal handlers).
I myself don't suffer from the issue, but it is theoretically possible
for Scintilla to emit signals anytime before it is destroyed, so it is
safer like this anyway. And an user on IRC suffered from crashes on
quit because of this issue, so it seems to actually happen in some
situations.
On Windows we need to change the working directory on startup to not
lock the directory Geany was started from (bug #2626124).
However we can't change the directory to late in the startup process
otherwise plugins maybe unable to load resources from the installation
directory.
Though we also can't change it too early otherwise opening files given
with relative paths in Geany from the command line won't work anymore
(bug #3613096).
This change should fix both issues by changing the working directory after
command line file handling happened and before plugins will be loaded.
We used to assume that if the selected text started with "0x" when
inserting a color, we had to replace exactly 6 bytes after the "0x"
prefix. Although this is generally the case as most color formats use
6 hexadecimal digits, it still would erase either too many or too few
characters if actually replacing something shorter (i.e. "0xfff") or
longer (i.e. "0xffffffffffff").
It could even partially override multi-byte characters if the 8th byte
after the selection start was in the middle of a character, as the
length was in bytes and not characters.
Fix this by honoring the actual selection end.
As suggested by a preprocessor warning from winsock2.h
(i686-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please
include winsock2.h before windows.h).
It seems this header is necessary on Windows 7 or newer gcc versions
(not sure which one requires it) but according to the docs, it is
necessary anyways.
Modification of the string "Use Windows File Open/Save dialogs" to
"Use Windows native dialogs".
Signed-off-by: bestel <steven.valsesia@gmail.com>
Signed-off-by: Colomban Wendling <ban@herbesfolles.org>
errno is never reset to 0 by the system libraries, so if we test
its value we need to reset it to 0 before the call that may change
it to something else.
Fix spawnning command under Windows when they contain spaces in both
the executable and the arguments. Apparently system() quoting is
unexpected, and doesn't work properly if there is more than 2 quotes
in the whole command.
To work this around, spawn the command through `cmd.exe /S /C`.
To do this we change the internal types to only use types matched by
symbols_get_current_scope(). This is a bit of a hack, but the tag
types were already questionable and simply mapped to ones the
TagManager know.
This however merges Functions and Subroutines under the same top-level
item in the symbol list.
Custom command callback never checked that the doc was still valid.
Can still paste in the wrong doc if user closes and opens while
the command is running, but not crash.
This fixes 'Go to Tag definition' for parsed Python imports as before the import
statement was chosen as the definition while we prefer the class definition as
target.
This is a requirement for an upcoming Python parser fix. This new category
will be currently only used by Python, C and D parsers. Before this change,
in C & D extern variables were sorted into the category "Other", now they
have their own category.
* Add an initialization function ft_init()
* Add a function-like macro to call ft_init() with shorter arguments
* Search and replace old code with FT_INIT() usage
* Layout into columns and add documentation above
* Adds TITLE_NONE, TITLE_SCRIPT and TITLE_DOCUMENT.
* Only a few filetype titles were tweaked but we should review the
rest as we could use TITLE_SCRIPT and TITLE_DOCUMENT a lot more
probably.
* Make filetype_make_title() not care about GeanyFiletype type and
return result instead of internally setting ft state.
g_return_if_fail() puts itself its condition in a G_LIKELY() clause,
and nested G_LIKELY() lead to warnings about shadowed variables, as
well as not being of any use.
Also, hiding G_LIKELY() in a macro may lead to unexpected use of it
which may hint the compiler incorrectly.
In build_run_cmd() the script was not deleted when any one of
several errors occurred. The errors are not related to script
contents so it makes no sense to leave the script.
Also fixes failure to delete script if a working dir was set.