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.
This is a mega-commit - because most of it had to be done in one go
otherwise some commits would fail to compile - that attempts to fix a
few problems with Geany's includes as well as various other related
cleanups. After this change it's easier to use includes and there's
little worry about which order things are included in or who includes
what.
Overview of changes:
* Include config.h at the start of each source file if HAVE_CONFIG_H
is defined (and never in headers).
* Go through each source file and make the includes section generally
like this:
- Always config.h first as above
- Then if the file has a header with the same name, include that
- Then include in alphabetical order each other internal/geany header.
- Then include standard headers
- Then include non-standard system headers
- Then include GLib/GTK+ related stuff
* Doing as above makes it easier to find implicit header include
dependencies and it exposed quite a few weird problems with includes
or forward declarations, fix those.
* Make geany.h contain not much besides some defines.
- Add a little header file "app.h" for GeanyApp and move it there
- Move "app" global to new "app.h" file
- Move "ignore_callback" global to "callbacks.h"
- Move "geany_object" global to "geanyobject.h"
* Add an include in "geany.h" for "app.h" since GeanyApp used to be
defined there and some plugins included this header to access
GeanyApp.
* Include "gtkcompat.h" everywhere instead of gtk/gtk.h so that
everywhere sees the same definitions (not a problem in practice AFAIK
so this could be changed back if better that way.
* Remove forward declarations from previous commits as some people
apparently consider this bad style, despite that it reduces inter-
header dependencies.
TODO:
* As always, to test on win32
* As always, to test with not Autotools
* Test plugins better, both builtin and geany-plugins, likely API/ABI bump
* Test with various defines/flags that may change what is included
* win32.[ch] not really touched since I couldn't test
This is for work on making the files scannable by GObject-Introspection
but is still useful otherwise (even fixes a FIXME in the comments). I
made this by using a simple GNU Make file and trying to compile the
sources each on their own without all the build system infrastructure.
* Add keybindingsprivate.h file to hold private GeanyKeyGroup structure
and remove it from the GEANY_PRIVATE guard in keybindings.h.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyFiletypes to GeanyFiletypesPrivate and remove guarded build.h
include.
* Move private members that were guarded by GEANY_PRIVATE from
GeanyProject to GeanyProjectPrivate.
Fix modulo zero error resulting in floating point exception, and then
crash. This was introduced in fd6ce2da11e9f2d20cb96236753662c23feaecb4.
Closes#265.
When loading a project and focusing the last document, the UI wouldn't
get properly updated for the displayed file -- because for performance
reasons we disable notebook page switch handlers when loading session
files. Fix this by synthesizing a notebook page switch event when done
loading.
Change utils_parse_color() to use gdk_color_parse() and follow its
syntax, additionally supporting our "0x" prefix as a synonym for the
"#" prefix; and use this everywhere.
Also add utils_color_to_bgr() and utils_parse_color_to_bgr() to provide
conversion to the 24 bits BGR format used by Scintilla.
In the preferences dialog it would show a single
quote because the print command couldn't be found
and the NULL prematurely terminated the g_strconcat()
call, leaving a single quote in the print command
entry.
Thanks to Lex for finding where the problem was.
Previously was hard coded with options to suit xterm. As this is
being replaced with different terminal programs some do not accept
the same options. The new setting stores the whole command with
%c to substitute the script name. Upgrades old settings if a new
one does not exist.
A preference for an icon doesn't make sense; if someone don't like
her theme's icon she should either switch to another theme, override
that specific icon or don't bother.
This reverts commit 6897cd49c69535c6563e56ae011c6f8382fec485.
Some users want the theme icon, some dislike the icon provided by
their theme and want the traditional Geany icon.
This makes that choice a various pref. Used a standalone global
to avoid impacting the plugin interface and CommandLineOptions
and GeanyStatus didn't make sense.
Since reading locale and reading encodings from within files by regex
can find encodings not on the Geany list, saving as text ensures that
any encoding found can be saved in the session, otherwise a file can
be opened but will not re-open because the encoding cannot be saved
in the session. Since numeric encoding names exist prefix the text
name by 'E' so they can be distinguished from saved numeric indexes.
This allows the user to define a label to be displayed in the menu in
place of the command to be run. This can be very useful if e.g. a
custom command is too complex to be easily read in the menu, or if two
custom commands are so similar could be confounded.
Add configuration option tab_close_switch_to_mru to allow the user
to choose whether to switch to the most recently used tab or to the
next one after closing the current tab.
Most noteworthy change is that all build commands IDs and groups are
now unsigned everywhere negative values aren't explicitly handled with
a special meaning. This should not change anything in behavior, only
makes clear the index won't underflow.
This adds an hidden VTE preference, send_cmd_prefix, that allows to
define a prefix for the commands Geany sends to the shell in the VTE
like "cd" when following current path.
This can be used for example to prevent some shells (Bash, ZSH, maybe
others) from putting these commands in the history by setting this to
a space.
Fixes bug #3425969. Replace Geany escaping of session filepaths
with g_uri_escape_string (available now in 2.16) allowing any
punctuation characters in the path.
* Processed with rstrip-whitespace.py script added to scripts/ directory.
* Script run on all .c and .h files in src/ and plugins/ directories.
* Also remove more than one newline at the end of files.