5116 Commits

Author SHA1 Message Date
Jiří Techet
3cf0161527 Store "equal" tags into binary trees instead of lists in Symbol tree
At the moment tags with identical names are stored into a linked list in
tags_table and parents_table. This however leads to quadratic complexity
when looking up the nearest parent or tag in tree because the whole list
has to be traversed.

Use binary trees indexed by line number instead of lists so the lookup can
be performed in log(N) time and the overall complexity is N*log(N) instead
of N^2.

The GTree API is a little stupid because during the search it doesn't give
access to the value and it doesn't tell when a leaf node was reached. For
this reason the lookup has to be made in two steps - first, the best line
number is found (returned in user_data) and then a normal search for the
found line number is made to get the value stored in the tree.

This patch fixes the problem described in #577 when e.g. a big json export
file contains many identically named tags.
2016-07-22 23:21:09 +02:00
Matthew Brush
313b85a149 Move enumerator to end of enum (oops)
This fixes the plugin ABI break that happened in previous commmit.
2016-07-13 16:06:17 -07:00
Abel 'Akronix' Serrano Juste
14904a18ff Added keybinding for Delete from line start to current position
Closes #1134
2016-07-13 15:51:10 -07:00
Colomban Wendling
5b6b89fd5b Post release version bump
Say hello to Geany 1.29 "Jowar"!
2016-07-10 16:07:56 +02:00
Colomban Wendling
9ba7f67238 Don't require plugin key group name and label strings to be static
Take a copy of the strings not to require them to live live as long as
the plugin does.

This is mostly useful for plugins implemented in dynamic languages
(e.g. through a plugin proxy), as most C plugins will use a static
string here; but it makes the API more straightforward and avoids odd
issues if any plugin doesn't use static strings here, even C ones.

Closes #1125.
2016-07-09 00:23:01 +02:00
Colomban Wendling
91b6304985 Fix utils_spawn_async()::child_pid annotations 2016-07-04 19:19:36 +02:00
Colomban Wendling
2ebe961c9e Add missing element-type annotation for GeanyData::filetypes_by_title 2016-06-28 20:47:22 +02:00
Colomban Wendling
114e339a7e Restore element-type annotation for GeanyData::documents_array
Broken in #966.
2016-06-28 20:46:24 +02:00
Colomban Wendling
65988f51f0 style: Reduce scope of several variables
No behavioral changes.
2016-06-25 16:15:08 +02:00
Colomban Wendling
d6c98f5ae6 Merge pull request #966 from codebrainz/private-globals
Privatize global and publicize docs
2016-06-23 23:34:19 +02:00
Colomban Wendling
72482e8e32 docs: Fix references to renamed symbols 2016-06-23 23:30:39 +02:00
Colomban Wendling
5ad6316e7b Merge pull request #1038 from kugel-/gi-signals
Fix signals for GI
2016-06-23 23:15:23 +02:00
Thomas Martitz
314a5c180e geanyobject: properly register signals
If possible, register signals with the proper argument types (boxed or gobject).
This is required for successful introspection of the signals and important
for GI-based plugins.

As for the marshallers, if available use a predefined one from glib. Otherwise
use the generic marshaller available since 2.30 (in theory all signals could
use that one but it has a bit of overhead).

This builds on the gboxed conversions of earlier commits.

This also bumps the minimum glib requirement.
 - g_cclosure_marshal_generic requires 2.30 (if NULL is passed as marshaller
   to g_signal_new())
 - G_TYPE_KEYFILE requires 2.32
2016-06-23 22:33:43 +02:00
Colomban Wendling
586e64b842 Merge pull request #527 from techee/eol_undo
Fix undo of line end type change
2016-06-23 19:38:25 +02:00
Jiří Techet
d097e8cd05 Make UNDO_ENCODING updates similar to other updates
Simply call ui_update_statusbar() and ui_document_show_hide() like in
other undo actions.
2016-06-23 18:15:21 +02:00
Jiří Techet
6a3a53f421 Fix undo of line end type change
At the moment undo of line end type change only undos the changes made
in the document but the different line ending settings remains active.

This patch fixes the issue by combining the line end scintilla undo action
with a new UNDO_EOL action responsible for updating the line ending
settings.

Fixes #409
2016-06-23 18:10:50 +02:00
Thomas Martitz
2acba3dc31 plugin api: export geanyobject
geanyobject can be used by plugins to connect to plugin signals directly
(required for GI-based plugins). Access through GeanyData::object. The related
doxygen comments are @gironly for now, since plugin_signal_connect() is still
preferred.

Finally, the useless function pointer prototypes are removed from the
GeanyObjectClass structure as they became useless (they have been unused and
generally wrong since ever).
2016-06-22 16:10:32 +02:00
Thomas Martitz
be64b177ca plugin api: convert GeanyEditor to GBoxed internally
GeanyObject signals require GTypes to be gobject-introspection compatible.
2016-06-22 16:10:31 +02:00
Thomas Martitz
7702a4639b plugin api: convert GeanyFiletype to GBoxed internally
GeanyObject signals require GTypes to be gobject-introspection compatible.
2016-06-22 16:10:11 +02:00
Thomas Martitz
60fb01d6db plugin api: convert GeanyDocument to GBoxed internally
GeanyObject signals require GTypes to be gobject-introspection compatible.
2016-06-22 16:09:56 +02:00
Enrico Tröger
fda89798a4 Merge pull request #912 from eht16/spawn_debug_output
Allow spawn debug output also with GEANY_DEBUG
2016-06-20 23:07:10 +02:00
Enrico Tröger
9a471d336d Merge pull request #1079 from eht16/win32_open_uri_error_handling2
Win32: Add UI error message if an URL could not be opened
2016-06-20 23:06:39 +02:00
Enrico Tröger
871a9089b4 Win32: Add UI error message if an URL could not be opened 2016-06-20 23:05:48 +02:00
Enrico Tröger
6aaaba6b41 Improve error message on Build->Run errors
Reword the error message and use the full executed command line
in the error message, not only the configured Terminal command.

Fixes #1077.
2016-06-20 01:39:56 +02:00
Colomban Wendling
f489043864 Merge pull request #946 from techee/scintilla_quartz
Enable buffered draw on newer GTK versions on OS X
2016-06-11 01:09:49 +02:00
Colomban Wendling
021bbfb82b Merge pull request #958 from techee/goto_popup
Improve Goto Symbol popup contents
2016-06-10 23:47:57 +02:00
Colomban Wendling
7fbe6ad832 Merge pull request #957 from techee/ctags_hook
TagManager cleanups
2016-06-10 23:09:09 +02:00
Jiří Techet
20e3681558 Try harder when definition/declaration was not found
Even when we know when should be searching for definition (or declaration),
we can keep searching for the opposite type too when we didn't find
anything with the "correct" def/decl type. So at least we find "something"
of that name.
2016-06-09 10:01:59 +02:00
Jiří Techet
ca8ef9643e Add parentheses in an if to make the condition more clear 2016-06-09 09:41:09 +02:00
Colomban Wendling
d95111d4cd Merge pull request #1039 from techee/highlight_fix2
Fix inconsistent typename highlighting updating.

Closes #1020, #1022.
2016-05-31 16:53:29 +02:00
Colomban Wendling
b007cc009e Remove redundant typedef with new Scintilla that breaks Windows builds 2016-05-30 12:22:24 +02:00
Jiří Techet
9356514e45 Perform typename re-colourisation only when typename list changes
To detect the change of typename list since the last time the colourisation
happened, we could store the complete typename string used during the
last colourization and compare it with the current string. For lots of
typenames this might be quite a huge string stored for every opened tab
(well, it's also stored in Scintilla already for every document but better
not to have it twice). Instead, we can store an uint hash of the string.
We could also use a better hash function with longer hash value but
uint size should be enough for this case (and in the case of a collision
nothing terrible happens).
2016-05-17 22:58:47 +02:00
Jiří Techet
9313b17559 Don't accumulate multiple colourises
I don't know if this ever happens but the check shouldn't hurt.
2016-05-17 22:09:48 +02:00
Jiří Techet
4896db17fe Revert "Colourise only the visible area when highlighting typenames"
This reverts commit b361b83276816633ac5a0d6d391b6f6e8ebe6cf1.

The patch doesn't quite work e.g. when using replace to replace a typename.
2016-05-17 22:04:28 +02:00
Colomban Wendling
d7750a4479 Fix canceling keybinding overriding by discarding the dialog
Properly handle discarding the dialog asking whether to override a
keybinding as canceling it rather than as allowing multiple identical
keybindings.

In the way, simplify and fix dialogs_show_prompt() not to perform odd
and useless response mapping that effectively go round back, and that
don't handle what the comment above it suggests.  Simply document it
can return GTK_RESPONSE_DELETE_EVENT and handle it in the caller side,
as it's a possibly valuable information.  Only one current caller is
affected, and it doesn't change anything as it doesn't change behavior
but only documents it.

Closes #714.
2016-05-17 02:45:03 +02:00
Colomban Wendling
9681888806 Merge pull request #1014 from b4n/streamline-builtin-tags
Streamline builtin tags
2016-05-15 15:58:05 +02:00
Colomban Wendling
056e53c2c5 Make our convenience libraries more self-contained
Make each convenience library depend on the ones it requires, which is
pretty straightforward for us as they each only depend on a single
other one, avoiding any worry about double linking of static objects.
2016-05-04 19:11:13 +02:00
Colomban Wendling
f948916ad0 Don't get properties of a non-current style state to please GTK 3.20
GTK 3.20 doesn't like getting a style property for a non-current state,
unless the call is wrapped in a save()/restore() pair.

So, fix the code to either use the current state or temporarily save
the context.

gb.c now uses different states, but it shouldn't really matter given
how they are used, and even gives a native behavior when the window
loses focus, as it now properly reacts to BACKDROP state.
2016-05-03 00:31:38 +02:00
Colomban Wendling
5851f5616e Merge branch 'gtk-version-specific-css' into gtk-3-20-fixes
Merges pull request #994.
2016-05-02 15:25:47 +02:00
Colomban Wendling
05870d9ebc Merge pull request #973 from techee/osx_keybindings
osx: force resync menus when changing keybindings
2016-04-30 00:22:58 +02:00
Colomban Wendling
854a5d5af8 Don't special-case tags files distributed with Geany
Load those tags files just as any user tags files, removing
unnecessary code redundancy.
2016-04-29 01:39:11 +02:00
Colomban Wendling
6b262bb4ec Make html_entities.tags a real tags file
This removes a fair amount of specific code that is just as well
handled by the generic symbols completion code.
2016-04-29 01:35:21 +02:00
Quentin Glidic
4374769b7c ui-utils: Fix ui_path_box_new with GTK+ >= 3.20
They introduced[1] a GtkBox between the GtkEntry and the GtkComboBox to
add some magic in the layout computation.

[1] <https://git.gnome.org/browse/gtk+/commit/?id=222c43fc60362eeb97ce2d5e3a5583a69a2e30ef>

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-04-17 11:57:38 +02:00
Quentin Glidic
1f392b75bf ui-utils: Load per-version GTK+ CSS file
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-04-14 13:17:12 +02:00
Jiří Techet
1c83b18e22 osx: force resync menus when changing keybindings
Normally menu items are updated only when adding or removing
them on osx. They are however not redrawn when just changing
keybindings so the old keybinding is displayed after the change.

Force the menu update to show the updated keybindings.
2016-03-23 20:45:47 +01:00
Jiří Techet
7be40f5832 Initialize ctags at a single place instead of four 2016-03-21 18:28:36 +01:00
Matthew Brush
d4aab06f9b Move some documentation to show up in API docs.
The Doxygen comments were on the non-public global filetypes_array and
filetypes_by_title variables instead of the GeanyData members which are
exposed to the plugin API and reference manual.
2016-03-14 14:25:35 -07:00
Matthew Brush
76ede69ef4 Remove documents_array global from plugin API
The global was never accessible to plugins on Windows and hasn't been
accessible to plugins on Linux and others since the linkage-cleanup
changes.

Move documentation from the global variable to the GeanyData member
of the same name.

Closes #964
2016-03-14 14:25:17 -07:00
Jiří Techet
3640b3bc44 Move *.tags files to the tags directory
ignore.tags is still in ~/.config/geany
2016-03-13 17:35:14 +01:00
Jiří Techet
e513e5a099 Move filetypes.* to the filedefs directory 2016-03-13 17:35:08 +01:00