5338 Commits

Author SHA1 Message Date
Colomban Wendling
198a0cf2ba Update a comment to better reflect the internal data changes 2017-09-23 11:59:20 -07:00
Colomban Wendling
fda8b97ea6 Keep the current tab when closing documents to the right of another tab 2017-09-18 12:54:23 -07:00
Colomban Wendling
b1e0d0948c Fix a typo (#1597) 2017-09-02 08:57:42 +02:00
Colomban Wendling
6522332ba9 Fix the symbols tree hierarchy when several tags have the same name
Fix the symbols tree hierarchy by considering the whole scope when
adding a tag, avoiding choosing the wrong parent when several tags have
the same name.  Until now, to avoid such misbehavior we only used to
choose the parent candidate that appeared last (line-wise) before the
child.  It works in most typical situations as generally tag names are
fairly unique, and children appear right after their parent.

However, there are cases that are trickier and cannot be handled that
way.  In the following valid C++ snippet, it is impossible to know
whether `function` should be listed under the namespace `A` or the
class `A` without looking at its full scope:

```C++
namespace A {
    namespace B {
        class A {
            void method() {}
        };
    };
    void function() {}
};
```

And it is a real-world problem for some parsers like the JSON parser
that generates numeric indices for array elements name, often leading
to several possibly close duplicates.

Additionally, to prevent trying to set a tag as its own parent, the
code guarded against accepting a parent if the child had the same name,
lading to incorrect hierarchy for `method` in cases like this:

```C++
namespace A {
    class A {
        void method() {}
    };
};
```

So to fix this, consider the whole hierarchy of a tag for choosing its
parent, when that information is available from the parser.

Fixes #1583.
2017-09-01 17:31:56 -07:00
Colomban Wendling
3ffc5773a0 Mark a local function static 2017-08-19 17:16:21 -07:00
Matthew Brush
44f96d08a8 Mark tm_get_real_path with G_DEPRECATED_FOR
This will allow the compiler to notify any callers that it's deprecated.
The macro is guarded-out for when Geany is compiling so it won't cause
warnings when tagmanager uses it internally and for the utils_ wrapper.
2017-08-04 03:44:31 -07:00
Matthew Brush
4a60cdd127 Add utils_get_real_path() and use it
This is a wrapper around tm_get_real_path() but is in a more suitable
namespace/module.
2017-08-04 03:31:25 -07:00
Matthew Brush
7261742f81 Allow plugins to get the data they set 2017-08-04 02:33:40 -07:00
Matthew Brush
a108f9162c Re-enable SIGTERM handling
Now that a new enough GLib is available the signal can be
handled cleanly on the main loop using the GSource for Unix signals.
This replaces the illegal SIGTERM handling that was disabled in
fbb89f523af47b35e238678d348cfa98e56c760a.

Closes #1255
2017-08-04 02:22:04 -07:00
Matthew Brush
a40823084e Add "Close Documents to the Right" feature
Similar to applications like Firefox and Chromium.
2017-08-04 01:55:43 -07:00
Jiří Techet
e43c8d8314 Always emit the project-save signal when writing project file
For some reason "project-save" isn't emitted when closing project - see
write_config(FALSE) in project_close(). This means that in this case
plugins cannot save their configuration into the config file. This doesn't
even correspond to the documentation of the signal

"Sent when a project is saved (happens when the project is created, the
 properties dialog is closed or Geany is exited)"

as the signal isn't emitted when exiting Geany because at this point Geany
closes the project.

The comment seems to indicate that the reason is that "project-save"
shouldn't be emitted when "project-close" is emitted but I don't see any
reason why.

Bump API so plugins can rely on the changed behavior.
2017-08-04 01:30:21 -07:00
Thomas Martitz
180e1da427 api: the commits 745f424 and 169feae should have incremented the API version, do so now
Increment one time for both, and fix the corresponding doc comments.
The comment for keybindings_load_keyfile() is reflowed to split into
brief/detail sections properly.
2017-08-04 01:13:11 -07:00
delt
38147b2590 Added an option to save/reload either window position or
size, but optionally not both.
2017-08-04 01:05:15 -07:00
Jiří Techet
745f424b77 Export keybindings_load_keyfile() for plugins
This allows plugins to reload keybindings later during their execution.
For more info see the comment in the commit.

Closes #1430
2017-08-04 00:37:19 -07:00
Thomas Martitz
169feae90e api: export tm_tag_get_type()
This indicates that TMTag is GBoxed-derived, and can be copied/ref'd.

This helps plugins that must store a tag pointer for later usage while the
tagmanager might let it go in the meantime (can happen quickly if the user
comments a function out when starting a doxygen-comment).

Closes #1465
2017-08-04 00:17:11 -07:00
Matthew Brush
bc7e64f78f Fix message formatting string 2017-08-03 23:48:30 -07:00
Matthew Brush
f90ebafe56 Improve Scintilla status messages output 2017-08-03 23:48:30 -07:00
Matthew Brush
6d663cbb0e Change all scintilla_send_message calls to use SSM macro 2017-08-03 23:48:30 -07:00
Matthew Brush
6c6eccd994 Check Scintilla status in debug builds
In the future, this could be moved to release-mode runtime errors which
try and pop-up a dialog message and/or recover gracefully.
2017-08-03 23:48:30 -07:00
Matthew Brush
371810181d Remove redundant SSM macros 2017-08-03 23:48:30 -07:00
Jiří Techet
b7c4bb0b4d Create correct path for filetype config files
Since filedef config files are now stored under the "filedef" subdirectory
of app->datadir, we need to add the subdirectory name when creating path
from the corresponding app->configdir otherwise the file isn't found.

Closes #1482
2017-08-03 23:41:21 -07:00
sinpowei
08e2714c1c Add an editor option to enable IME's candidate window display inline,
fix the issue that candidate window can't follow cursor.

Closes #1514
2017-08-03 23:23:42 -07:00
Enrico Tröger
59e6a8c75f Add missing string and comment styles for various lexers (#1502)
* Add missing string and comment styles for various lexers

A bunch of string and comment styles were missing and so Geany could not
detect the corresponding styles in code.

* Add more string styles

* Add regex styles as string styles
2017-08-03 23:03:50 -07:00
Franz König
df2a99f275 a little typo in the list of translators (#1565) 2017-07-29 16:43:23 +02:00
Colomban Wendling
03e5bb9fac Fix crash if plugin manager is opened more than once (#1564)
Do not allow more than one plugin manager dialog at a time.  It doesn't
make sense and the code is not fully re-entrant and leads to a crash
toggling plugins in both dialogs.

Fixes #1563.
2017-07-27 21:15:55 -07:00
Thomas Martitz
18d524525d editor: fix incorrect variable reference
The variable used for setting the cursor isn't used anymore and
was used uninitialized. It's simply deleted now and the correct var is used.

This was only a problem if editor_insert_text_block() was used directly,
the snippet code path doesn't reach to it.
2017-07-26 22:39:02 +02:00
Thomas Martitz
b2668dae67 Better snippets (#1470)
* snippets: Allow keybinding overloading of snippet-next-cursor.

This allows to use the same key as for inserting snippets, or plugins to
map something to the same keybinding (e.g. if they implement a similar facility).

* snippets: Remove cursor position at the end of constructs.

This is not consistently done for all languages, and hard to get right
e.g. for python. It's probably not terribly useful either.

* snippets: Use Scintilla indicators for cursor posititons
* api: Increment API version.
* snippets: restore behavior of cursor-less snippets
* snippts: use ascii character for the placeholder.

Do not require documents to be UTF-8 for using snippets.

* snippets: fix start/end detection, when searching for the next cursor

Tested @vfaronov
2017-07-21 16:42:58 +10:00
Vasiliy Faronov
2abf72a178 Push current position to navqueue before navigating back (#1537) 2017-07-21 15:59:36 +10:00
Mark O'Donovan
75a69aad93 Added option to auto reload files changed on disk (#1246)
When option is enabled geany automatically reloads files which
have changed on disk but have no changes in the buffer.
When the option is disabled (default) geany shows the reload
dialog as before.

Tested @vfaronov
2017-07-17 17:44:54 +10:00
Enrico Tröger
2d9f97debd Post release version bump
Say hello to Geany 1.32 "Bemos"!
2017-07-16 15:29:55 +02:00
Vasiliy Faronov
4f1b2a0313 Fix converting color to hex for insertion
Fixes #1527.

In win32_show_color_dialog, utils_scale_round is not necessary at all
because Get{R,G,B}Value [1] already return 0..255, which we can immediately
render as hex.

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/dd144923.aspx
2017-07-08 18:46:01 +03:00
Samsul Ma'arif
1305b43a98 Update Indonesian translation (#1501)
Signed-off-by: Samsul Ma'arif <hay@samsul.web.id>
2017-05-25 10:20:15 +02:00
Dimitar Toshkov Zhekov
1a19b39721 Read stdout/stderr in a loop when using timeout callbacks
With single reads, the input processing is limited to
(1/0.050 * DEFAULT_IO_LENGTH) KB/sec, which is pretty low.

Moved the check whether the maximum empty G_IO_IN-s are reached to a
macro, SPAWN_CHANNEL_GIO_WATCH(sc).
2017-04-26 21:32:00 +03:00
Dimitar Toshkov Zhekov
673a714645 Fix the maximum number of G_IO_IN-s without any data
They should have been 200, not 3.
2017-04-16 18:06:55 +03:00
Jiří Techet
2707006286 Fix crash when plugin_set_key_group() is called several times by plugins (#1426)
When plugin calls plugin_set_key_group() several times for the same
group (when creating keybindings dynamically and needs to reset them),
it crashes with the current code the second time it gets called.

The reason is that group->plugin_keys is an array into which entries of
group->key_items point and when calling

g_ptr_array_set_size(group->key_items, 0);

it calls free_key_binding() for every item - when these items are
deallocated by g_free(group->plugin_keys) previously, calls of
free_key_binding() reference an invalid memory.

Just first resizing group->key_items (and calling free_key_binding() for
its items) and freeing group->plugin_keys afterwards fixes the problem.
2017-04-15 20:48:03 +10:00
Nick Treleaven
5539c3f908 Update status bar after clicking detect indent type menu item 2017-04-12 09:05:56 +01:00
Dimitar Toshkov Zhekov
ce284096a9 Handle continuous G_IO_IN-s without any data
Some versions of GLib under Linux continuously generate G_IO_IN-s
without any data to read when using recusrive channel watch sources,
causing 100% CPU load. This patch detects such a situation, and
automatically switches the affected source from channel watch to
50ms timeout.
2017-04-07 20:12:17 +03:00
Robert Antoni Buj Gelonch
d34ebce039 Update Catalan translators (#1440) 2017-03-22 11:18:16 +01:00
Colomban Wendling
3303bde758 Post release version bump
Say hello to Geany 1.31 "Trevin"!
2017-03-05 16:17:03 +01:00
Enrico Tröger
fc6f3ffebe Update copyright years 2017-03-05 13:27:15 +01:00
elextr
cc7f7f7164 Merge pull request #1406 from kugel-/for-upstream
api: new function geany_api_version for dynamic languages checking API version at runtime
2017-03-03 21:00:27 +10:00
Colomban Wendling
b7900b3f05 Merge pull request #1399 from techee/osx_start
Avoid gdk_display_get_name() on OS X
2017-02-27 18:09:59 +01:00
Colomban Wendling
3b105ec827 Merge pull request #1404 from b4n/search/gtk-3-20-history
Fix search history filling on GTK >= 3.20
2017-02-27 14:18:50 +01:00
Thomas Martitz
7b091809db api: new function geany_api_version
This allows plugins to detect the API version of Geany at runtime. This enables
soft dependencies based on Geany's API version, perhaps using a new feature
with a fallback for older API versions. Previously the only alternatives
were hard-depending on a more recent Geany version or ignoring new features.
2017-02-24 16:24:16 +01:00
Colomban Wendling
9a230e1f45 Fix search history filling on GTK >= 3.20
Since GTK 3.19.12, GtkComboBox has an intermediate GtkBox internal
child wrapping the inner GtkEntry.  To get the entry,
`gtk_bin_get_child()` still works as it is part of the API, but the
change breaks the assumption we had that it works the other way around,
that `gtk_widget_get_parent(gtk_bin_get_child(combobox)) == combobox`.
So, while this assumption seemed reasonable, stop relying on it as it
is effectively not correct on GTK 3.20 and newer.

See: https://git.gnome.org/browse/gtk+/commit/?id=222c43fc60362eeb97ce2d5e3a5583a69a2e30ef
2017-02-21 23:23:49 +01:00
Colomban Wendling
93f273428a Update for new Scintilla styles 2017-02-21 14:16:56 +01:00
Jiří Techet
ed46b65c00 Avoid gdk_display_get_name() on OS X
More in the comment.
2017-02-16 11:45:46 +01:00
Vasiliy Faronov
7347631563 Fix setting menu item labels dynamically
Fixes https://github.com/geany/geany-plugins/issues/462
2017-02-16 01:44:53 +03:00
Colomban Wendling
2c1a71ad2b Use :select/:deselect signals for consistency
Instead of having a handler on 2 separate objects, use :select and
:deselect on the same one.  Those signals are appropriate, as the
documentation mentions that submenus are popped up on :select.
2017-02-05 15:34:24 +01:00
Forkest
67d6562f20 Fix cut and copy actions in non-Latin keyboard layouts
Mark the associated menu items sensitive when the menu is hidden, so
that GTK's accelerator handling can trigger them.  This works around
incorrect handling in Geany's code of keybindings coming from multiple
layouts for cut/copy/delete actions.

Partial workaround for #998, #1286 and #1368.
2017-02-05 12:52:51 +01:00