This is one more attempt on unifying `TMTag`s and externally provided symbols for the symbol tree before giving up and making the plugins create the symbol tree by themselves (which leads to quite a significant code duplication). This time (unlike the previous attempts) I'm quite happy with the result though. I called the new structure `GeanySymbol` - could be renamed to something else if someone has better idea.
The idea is to make `GeanySymbol` operate in two modes:
- either it is backed by a `TMTag` and created using `GeanySymbol *geany_symbol_new_from_tag(TMTag *tag)`
- or it is created by some external source such as the LSP plugin using
```C
GeanySymbol *geany_symbol_new(gchar *name, gchar *detail, gchar *scope, gchar *file,
TMParserType lang, glong kind, gulong line, gulong pos, guint icon)
```
The corresponding structure looks this way:
```C
typedef struct GeanySymbol
{
gchar *name;
gchar *detail;
gchar *scope;
gchar *file;
TMParserType lang;
gulong line;
gulong pos;
glong kind;
guint icon;
TMTag *tag;
gint refcount; /* the reference count of the symbol */
} GeanySymbol;
```
where either `tag != NULL` when using `geany_symbol_new_from_tag()`, or `tag == NULL` for `geany_symbol_new()`.
The important part is that the members of `GeanySymbol` cannot be accessed directly from other files but only using getters that either use the `tag` or the member of `GeanySymbol` such as
```C
const gchar *geany_symbol_get_name(const GeanySymbol *sym)
{
if (sym->tag)
return sym->tag->name;
return sym->name;
}
```
By this interface, all callers like the symbol tree implementation are completely shielded from the details of where the symbol comes from. The bulk of the diffs inside `symbols.c` is pretty much just using this interface instead of using `TMTag` directly and renaming `tag` to `symbol`. `get_symbol_name()` and `get_symbol_tooltip()` were moved to `GeanySymbol` implementation, and also (previously inlined) `geany_symbol_get_name_with_scope()` was moved there too.
The additional `PluginExtension` interface for using these symbols would be more or less identical to what I proposed in https://github.com/geany/geany/pull/3850, i.e.
```C
gboolean (*doc_symbols_provided)(GeanyDocument *doc);
GPtrArray *(*doc_symbols_get)(GeanyDocument *doc);
```
and
- either additional `void (*doc_symbols_request)(GeanyDocument *doc, GCallback on_done);` in this interface making Geany request the extension for symbols (asynchronously)
- or some `symbol_tree_reload()` function the plugin could call which would make Geany re-request symbols using `doc_symbols_get()` after the plugin gets them e.g. from the LSP server
@b4n How does something like this sound? The implementation here is incomplete (only tested with the `TMTag` "backend" of `GeanySymbol`) but I don't want to continue in case you have some reservations regarding this approach.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3910
-- Commit Summary --
* Possible extension interface for symbol tree
-- File Changes --
M meson.build (3)
M src/Makefile.am (1)
M src/sidebar.c (7)
M src/sidebar.h (2)
A src/symbol.c (341)
A src/symbol.h (67)
M src/symbols.c (426)
M src/symbols.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/3910.patchhttps://github.com/geany/geany/pull/3910.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3910
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3910(a)github.com>
After losing focus, the key release of Ctrl+tab isn't delivered to the handler and the MRU window is shown "forever" (or until it's removed by repeated ctrl+tab).
There are 2 situations when focus loss may happen:
1. In the 600ms interval when the MRU popup isn't shown yet but tabs are already being switched. This is handled by checking whether the main window has focus in on_switch_timeout() and the MRU window isn't shown when the focus is lost.
2. After the MRU popup is shown. This is handled by connecting to "focus-out-event" of the main window and stopping the switch in its handler.
Fixes #3330.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3907
-- Commit Summary --
* Fix stuck MRU dialog when Geany loses focus
-- File Changes --
M src/notebook.c (47)
-- Patch Links --
https://github.com/geany/geany/pull/3907.patchhttps://github.com/geany/geany/pull/3907.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3907
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3907(a)github.com>
This is just a quick test of multiple carets for Geany. IMO we don't need a full support of everything working on multiple carets, users typically just need to insert/delete things at multiple places simultaneously for which this is sufficient.
Ideally, this should be mapped to alt+click as this is what vscode does and also we use alt+shift for the block caret. I only did run into a problem on macOS where (currently in a virtual machine) I get `GDK_MODIFIER_RESERVED_25_MASK` instead of `GDK_MOD1_MASK` but I'm always confused with GDK events so I'm maybe doing something wrong.
(Comparing to the LSP plugin, the ratio of the number of thumbs up for this feature to the amount of time spent on implementing it is quite favorable ;-)
Fixes #1141
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3899
-- Commit Summary --
* Preliminary support of multiple cursors
-- File Changes --
M src/editor.c (5)
-- Patch Links --
https://github.com/geany/geany/pull/3899.patchhttps://github.com/geany/geany/pull/3899.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3899
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3899(a)github.com>
This could be X windows or XFCE related, sorry I have no idea.
geany -V; geany 1.36 (built on 2020-03-22 with GTK 3.24.14, GLib 2.64.1)
OS is Mint 20.3 Una XFCE edition
To reproduce;
- open geany
- type "a" in untitled
- ctrl-n
- press and hold ctrl-tab to switch tabs, release tab key but keep ctrl key held down till popup shows
- click any menu
- release ctrl
- Now popup is stuck as always on top until geany is closed
See attached screen capture for example (you may need to download it first to view)
https://user-images.githubusercontent.com/72730470/200763465-e06bbdc2-bba1-…
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3330
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/issues/3330(a)github.com>
This is my second attempt on the LSP API as originally proposed by #3571.
I changed several things:
1. I renamed the struct `Lsp` to `PluginExtension` - there's nothing LSP-specific in this interface and it could be used by other plugins too (or possibly extended in the future if some plugins wanted to provide another functionality, we could extend this API).
2. I reduced the number of functions in the API to the absolute minimum and tried to do as much as possible in the plugin itself.
3. For this PR I removed the API related to the sidebar symbol tree - this one requires most changes on the Geany side and possibly more discussion and I don't want to block this PR by it. One possible alternative is also just keep using TM for the symbol tree, ignoring the symbols provided by LSP (the symbol tree is the least problematic part of TM IMO and could stay the way it is). I'll post the extra patches to allow sidebar symbols in a separate PR.
I also updated the combined Geany+LSP plugin at https://github.com/techee/geany-lsp to use the new API and also to work even when compiled against unmodified Geany. This is quite clumsy, however - to avoid conflicts between Geany's TM implementation and the plugin, it requires disabling TM by adding
```
[settings]
tag_parser=
```
to the filetype config file of the affected filetypes, basically disabling all TM features. It also requires separate keybindings for e.g. tag goto or autocompletion instead of re-using the Geany ones.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3849
-- Commit Summary --
* Add interface used by plugins to replace some Geany functionality with their own implementation
* Add Geany code delegating autocompletion to plugins
* Add Geany code delegating calltips to plugins
* Add Geany code delegating symbol goto to plugins
* Add Geany code delegating keyword highlighting to plugins
-- File Changes --
M meson.build (3)
M plugins/geanyplugin.h (1)
M src/Makefile.am (2)
M src/document.c (4)
M src/editor.c (34)
M src/keybindings.c (13)
A src/pluginextension.c (141)
A src/pluginextension.h (76)
M src/symbols.c (11)
M src/symbols.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/3849.patchhttps://github.com/geany/geany/pull/3849.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3849
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3849(a)github.com>
The pasted data might contain sensitive information and the pastebin service might be public and might not allow deleting a paste (at least not in a way the plugin supports). Thus, ask confirmation by default in case the user accidentally triggered the action.
@xiota does this make you a tad more comfortable? The UI isn't stellar, but it gets the job done and fearless users can disable it.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/1361
-- Commit Summary --
* geniuspaste: Ask confirmation before pasting
-- File Changes --
M geniuspaste/TODO (1)
M geniuspaste/src/geniuspaste.c (82)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/1361.patchhttps://github.com/geany/geany-plugins/pull/1361.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1361
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/pull/1361(a)github.com>