Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Sun, 30 Jun 2024 09:38:57 UTC Commit: 3edf06b7252a9f40a0ee54dfcebefa30f71bb368 https://github.com/geany/geany/commit/3edf06b7252a9f40a0ee54dfcebefa30f71bb3...
Log Message: ----------- Add Geany code delegating autocompletion to plugins
Modified Paths: -------------- src/editor.c src/keybindings.c
Modified: src/editor.c 12 lines changed, 7 insertions(+), 5 deletions(-) =================================================================== @@ -46,6 +46,7 @@ #include "highlighting.h" #include "keybindings.h" #include "main.h" +#include "pluginextension.h" #include "prefs.h" #include "projectprivate.h" #include "sciwrappers.h" @@ -857,13 +858,11 @@ static void on_char_added(GeanyEditor *editor, SCNotification *nt) case ':': /* C/C++ class:: syntax */ /* tag autocompletion */ default: -#if 0 - if (! editor_start_auto_complete(editor, pos, FALSE)) - request_reshowing_calltip(nt); -#else editor_start_auto_complete(editor, pos, FALSE); -#endif } + + plugin_extension_autocomplete_perform(editor->document, FALSE); + check_line_breaking(editor, pos); }
@@ -2222,6 +2221,9 @@ gboolean editor_start_auto_complete(GeanyEditor *editor, gint pos, gboolean forc
g_return_val_if_fail(editor != NULL, FALSE);
+ if (plugin_extension_autocomplete_provided(editor->document, NULL)) + return FALSE; + if (! editor_prefs.auto_complete_symbols && ! force) return FALSE;
Modified: src/keybindings.c 6 lines changed, 5 insertions(+), 1 deletions(-) =================================================================== @@ -43,6 +43,7 @@ #include "msgwindow.h" #include "navqueue.h" #include "notebook.h" +#include "pluginextension.h" #include "prefs.h" #include "sciwrappers.h" #include "sidebar.h" @@ -2151,7 +2152,10 @@ static gboolean cb_func_editor_action(guint key_id) sci_send_command(doc->editor->sci, SCI_LINETRANSPOSE); break; case GEANY_KEYS_EDITOR_AUTOCOMPLETE: - editor_start_auto_complete(doc->editor, sci_get_current_position(doc->editor->sci), TRUE); + if (plugin_extension_autocomplete_provided(doc, NULL)) + plugin_extension_autocomplete_perform(doc, TRUE); + else + editor_start_auto_complete(doc->editor, sci_get_current_position(doc->editor->sci), TRUE); break; case GEANY_KEYS_EDITOR_CALLTIP: editor_show_calltip(doc->editor, -1);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).