Setting the document text as changed makes it too easy to accidentally
overwrite the file - e.g. when closing you're reminded to save it.
It also makes it slower to close documents you no longer want open.
Setting text as changed is still done if the user cancels the warning.
Don't assume changing the style inside a style-set handler results in
recursion, as it would be wrong if the next signal emission was
triggered asynchronously. Instead, only modify the style if it isn't
already as we want it.
This fixes the about dialog's style-set handlers on GTK 3.10 which
didn't liked constant style updating.
This reverts commit ec7071062c5dc39d5f893a830b3c26968a579251.
Apparently the selected state of an event box doesn't necessary mean it
will be styled with a selection background color. This e.g. isn't the
case in GTK 3.14's Adwaita (default) theme.
So, revert the commit that removed custom style overrides. Next commit
will fix the GTK 3.10 problem this reverted commit fixed.
Useful for when using, for example, GTK+, SDL, and other C-only APIs
in files with the C++ filetype. Before only the symbol auto-completion
worked, but not the highlighting of type names.
TODO: figure out why taking something like SDL.c.tags and making a copy
as SDL.cpp.tags doesn't work, once that's fixed, this extra condition
could probably be removed.
Save As on an empty document would cause warnings like:
sys:1: Warning: g_regex_match_full: assertion 'string != NULL' failed
because SCI_GETRANGEPOINTER returns NULL then.
On a Ubuntu 12.04 system this warning even crashed Geany at writing the
log message.
So, simply don't search for anything if the document is empty.
Ask whether to adopt the existing session documents.
Also fixes the existing bug of not reloading the default session when
an existing project is open and a new project is cancelled.
Add GeanyDocument::id, document_find_by_id() to plugin API.
This also fixes clicking on a Messages item whose document has been
closed and reused. Now the click will be ignored instead of jumping to
an unexpected line in the new document.
Passed-in flags was always 0, so the argument is not useful.
Also, this function expected Scintilla search flags rather than Geany
ones, making the API confusing for no good reason.
`entries_modified` global is only used by on_name_entry_changed() and
on_entries_changed(), both of which are only ever called from
project_new() scope -- which already initializes this variable.
Use gtk_dialog_run() to run the key input dialog, which is modal anyway.
This avoids having to pass the label and the iter around for the dialog
response callback to have them, as they now only are used directly in the
function setting them in the first place.
This however doesn't get rid of any of the global data itself, it only pack it
in a struct and passes pointer to this struct around instead of accessing the
global whenever possible.
Apparently the ::unrealize symbol is sent too late, after we destroyed
the widget and freed the GeanyDocument, and some signals like
::focus-in-event can still be fired on the widget after that.
So, properly use the ::destroy signal that is supposed to be fired when
others should release references to that instance.