This actually fixes a theoretical bug introduced when notebook pages
stopped being ScintillaWidgets, but this bug had no effect because it
was in a dead code path -- because no, `page_num` never is -1 nor
`page` NULL.
The ::document-activate signal was not emitted when opening the first
tab of the notebook, e.g. when the tab count changed from 0 to 1.
This is because the ::document-activate signal is emitted in response
to the GtkNotebook::switch-page signal, which is emitted whenever the
currently displayed page changes. When there already is a current page
(when there is one or more pages), adding a new page does not trigger
the signal, as this new page doesn't become the current one (we will
switch to it later). However, when there are none, the newly added one
becomes current, and so the signal is emitted right away.
This is problematic because when we add the page to the notebook, the
document associated with it is not yet ready (only partly initialized),
and so we can't emit the signal on a valid document, and we discard it.
Not emitting this signal leads to inconsistent behavior introducing
subtle bugs in plugins relying on it.
To work this around, only show the page widget (the child added to the
notebook) after we finished initializing everything. This is the
simplest fix, because a lot of the code around document creation and
opening depend on the fact the page is already added, so while delaying
the page addition sounds like the more sensible fix, it has non-trivial
consequences that would require a large amount of work to overcome.
Note that interestingly, in addition to our problem, GtkNotebook seems
to have a bug as it emits the ::switch-page right when adding the first
page even if that page is not visible. However, it properly emits it
again when the child becomes visible, so we just still discard the
first emission like we used to.
While all normal keybindings use the Command key instead of
control key on OS X, all the command-line applications and
terminal emulators use the Ctrl key like on Linux. This includes
Ctrl+C (SIGINT) and Ctrl+D (EOF) for which there is some
special handling in the VTE support in Geany and which should
use GDK_CONTROL_MASK instead of GEANY_PRIMARY_MOD_MASK.
Also don't default to CR if OS is neither Windows nor Unix (including OS X).
There's no other GTK backend right now so it doesn't matter much but
still if something else appears, it will most probably not have CR line
endings.
As discussed in #410, the previous SF redirect is better replaced by
a redirect on www.geany.org which we can control.
This way we can also quickly change the target URL if it changes at
Paypal.
Since document_compare_by_tab_order_reverse does the exact reverse of
document_compare_by_tab_order the code need not to be duplicated. Instead
document_compare_by_tab_order can be called and the return value be reversed.
Fonts are rendered much smaller on OS X so use bigger sizes
by default. Also, by default they use the Light style which is
extremely thin - use Medium instead. Finally, use better monospace
font than the default Courier (Menlo is derived from Dejavu Sans
Mono and is used by XCode and other editors).
In order to execute the runner script using the terminal application,
the script has to be executable, otherwise it's not executed.
In addition, when the terminal application starts, it sets $HOME
as the working directory. For this reason the working directory
has to be set in the runner script (to avoid additional ifdefs,
this part is shared with other unix systems where the additional
"cd" shouldn't matter).
On OS X the Command key is used for common keybindings instead
of Ctrl. Introduce a new macro, GEANY_PRIMARY_MOD_MASK that
represents the Command key on OS X and Ctrl on other platforms.
For some events, such as mouse key press, GDK_MOD2_MASK is returned
for the Command key by GTK instead of GDK_META_MASK (which is returned
when Command is pressed together with some other key). To hide this
behavior from users, introduce keybindings_get_modifiers() which can be
used instead of gtk_accelerator_get_default_mod_mask() and which
inserts GDK_META_MASK when GDK_MOD2_MASK is found in the mask
on OS X.
It may happen that even though we get GIcon, the actual icon
dosen't exist (typically on Windows and OS X). Check if we
can find the actual icon.
In addition, use "icon name" instead of "stock id" - the latter
doesn't work on OS X / Windows for some reason.
The GIOCondition is always set to G_IO_IN even when input end
is reached (and no other flags are set) so the read_fif_io()
function never returns FALSE which causes an infinite loop.
It is necessary to check also the return value of
g_io_channel_read_line() and return FALSE on EOF or error.
This feature looks like a poorly implemented subset of "Complete word",
but lacks some important features like prefix filtering. It is also
misnamed as it shows not only macros, but also variables and enums.
It also only shows `editor_prefs.autocompletion_max_entries`, but does
so from *each* file, not as a whole.
So drop it altogether, as this feature doesn't really look useful and
the current implementation seem to suffer of too many shortcomings for
it to realistically be actually used.
Always select the default scheme by default in the Color Scheme dialog
not to end up selecting none in case of broken or nonexistent
configuration. This matches which scheme is actually used, and fixes
use of an uninitialized iter when no scheme would be selected.
Make go one of the builtin filetypes, add the parser and update the related
source and config files. While there, remove Rust from [Groups] in
filetype_extensions.conf because it's already a builtin filetype as well.
The parser itself is stolen from the fishman/ctags repo.
The issue was introduced in b646424ddb715382a937d233a75bc684c22e18ec as
it removed the default handler that used to destroy the infobar.
Now, the infobar is properly closed, but only if the action succeeded.
Closes#375.
Strict dependency on fnmatch was removed in 52076d19e8fe7ab41ebc92928e.
We still have an optional dependency on it from CTags, but I don't
think we use this code, and anyways the checks we had for the optional
path to be taken were incorrect, so it was never actually used.
So, drop the dependency on libibrety for Windows builds, and fix the
remaining checks for an optional fnmatch so if it is found it can
actually be used.