[gnome-builder/wip/gtk4-port: 982/1774] plugins/editorui: ignore OVR/INS in vim mode
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 982/1774] plugins/editorui: ignore OVR/INS in vim mode
- Date: Mon, 11 Jul 2022 22:31:30 +0000 (UTC)
commit 1533166b68877bc784996c023f735e1146697a06
Author: Christian Hergert <chergert redhat com>
Date: Wed May 11 14:23:26 2022 -0700
plugins/editorui: ignore OVR/INS in vim mode
Since this already includes a command bar with the current mode.
src/plugins/editorui/gbp-editorui-workspace-addin.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/editorui/gbp-editorui-workspace-addin.c
b/src/plugins/editorui/gbp-editorui-workspace-addin.c
index 5e7c24f26..0f81fec41 100644
--- a/src/plugins/editorui/gbp-editorui-workspace-addin.c
+++ b/src/plugins/editorui/gbp-editorui-workspace-addin.c
@@ -56,6 +56,8 @@ struct _GbpEditoruiWorkspaceAddin
GtkLabel *mode_label;
+ GSettings *editor_settings;
+
guint queued_cursor_moved;
};
@@ -416,6 +418,8 @@ gbp_editorui_workspace_addin_load (IdeWorkspaceAddin *addin,
NULL);
panel_statusbar_add_suffix (self->statusbar, 1004, GTK_WIDGET (self->position));
+ self->editor_settings = g_settings_new ("org.gnome.builder.editor");
+
IDE_EXIT;
}
@@ -432,6 +436,7 @@ gbp_editorui_workspace_addin_unload (IdeWorkspaceAddin *addin,
g_clear_object (&self->buffer_signals);
g_clear_object (&self->view_signals);
+ g_clear_object (&self->editor_settings);
g_clear_handle_id (&self->queued_cursor_moved, g_source_remove);
@@ -452,6 +457,7 @@ gbp_editorui_workspace_addin_page_changed (IdeWorkspaceAddin *addin,
IdePage *page)
{
GbpEditoruiWorkspaceAddin *self = (GbpEditoruiWorkspaceAddin *)addin;
+ g_autofree char *keybindings = NULL;
IdeSourceView *view = NULL;
IdeBuffer *buffer = NULL;
@@ -476,11 +482,13 @@ gbp_editorui_workspace_addin_page_changed (IdeWorkspaceAddin *addin,
notify_indentation_cb (self);
update_position (self);
+ keybindings = g_settings_get_string (self->editor_settings, "keybindings");
+
gtk_widget_set_visible (GTK_WIDGET (self->indentation), page != NULL);
gtk_widget_set_visible (GTK_WIDGET (self->line_ends), page != NULL);
gtk_widget_set_visible (GTK_WIDGET (self->position), page != NULL);
gtk_widget_set_visible (GTK_WIDGET (self->encoding), page != NULL);
- gtk_widget_set_visible (GTK_WIDGET (self->mode_label), page != NULL);
+ gtk_widget_set_visible (GTK_WIDGET (self->mode_label), page != NULL && !ide_str_equal0 (keybindings,
"vim"));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]