[gnome-builder/wip/gtk4-port: 925/1774] plugins/cpack: test out ctrl+shift+f to reformat decls
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 925/1774] plugins/cpack: test out ctrl+shift+f to reformat decls
- Date: Mon, 11 Jul 2022 22:31:28 +0000 (UTC)
commit 25a09c21f895631c8b592f9a44324f2d860548ed
Author: Christian Hergert <chergert redhat com>
Date: Sun May 8 13:39:26 2022 -0700
plugins/cpack: test out ctrl+shift+f to reformat decls
If we're currently focused editing a header file and there is a selection,
use ctrl+shift+f to reformat the declarations.
src/plugins/c-pack/c-pack.gresource.xml | 1 +
src/plugins/c-pack/cpack-editor-page-addin.c | 2 --
src/plugins/c-pack/gtk/keybindings.json | 1 +
3 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/c-pack/c-pack.gresource.xml b/src/plugins/c-pack/c-pack.gresource.xml
index 9cda0e405..cc5b10ebd 100644
--- a/src/plugins/c-pack/c-pack.gresource.xml
+++ b/src/plugins/c-pack/c-pack.gresource.xml
@@ -2,5 +2,6 @@
<gresources>
<gresource prefix="/plugins/c-pack">
<file>c-pack.plugin</file>
+ <file>gtk/keybindings.json</file>
</gresource>
</gresources>
diff --git a/src/plugins/c-pack/cpack-editor-page-addin.c b/src/plugins/c-pack/cpack-editor-page-addin.c
index b9ee9ade9..4c9bd144a 100644
--- a/src/plugins/c-pack/cpack-editor-page-addin.c
+++ b/src/plugins/c-pack/cpack-editor-page-addin.c
@@ -41,13 +41,11 @@ format_decls_cb (GSimpleAction *action,
g_autofree gchar *input = NULL;
g_autofree gchar *output = NULL;
IdeBuffer *buffer;
- IdeSourceView *sourceview;
GtkTextIter begin, end;
g_assert (IDE_IS_EDITOR_PAGE (view));
buffer = ide_editor_page_get_buffer (view);
- sourceview = ide_editor_page_get_view (view);
/* We require a selection */
if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (buffer), &begin, &end))
diff --git a/src/plugins/c-pack/gtk/keybindings.json b/src/plugins/c-pack/gtk/keybindings.json
new file mode 100644
index 000000000..619aa645d
--- /dev/null
+++ b/src/plugins/c-pack/gtk/keybindings.json
@@ -0,0 +1 @@
+{ "trigger" : "<Control><Shift>f", "action" : "cpack.format-decls", "when" : "inEditorWithLanguage(\"chdr\")
&& hasSelection()", "phase" : "capture" },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]