[gnome-builder/wip/gtk4-port: 1007/1774] plugins/vim: ^Wv and ^Ws
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 1007/1774] plugins/vim: ^Wv and ^Ws
- Date: Mon, 11 Jul 2022 22:31:31 +0000 (UTC)
commit 038f06e586dd5f36fb243c3fd8fe74c8b7d86c73
Author: Christian Hergert <chergert redhat com>
Date: Fri May 13 21:57:06 2022 -0700
plugins/vim: ^Wv and ^Ws
split however still needs to create a new row.
src/plugins/vim/gbp-vim-editor-page-addin.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
---
diff --git a/src/plugins/vim/gbp-vim-editor-page-addin.c b/src/plugins/vim/gbp-vim-editor-page-addin.c
index 12bcf068a..e4236b13d 100644
--- a/src/plugins/vim/gbp-vim-editor-page-addin.c
+++ b/src/plugins/vim/gbp-vim-editor-page-addin.c
@@ -406,5 +406,34 @@ gbp_vim_editor_page_addin_execute_command_cb (GbpVimEditorPageAddin *self,
IDE_RETURN (TRUE);
}
+ if (g_str_equal (command, "^Wv"))
+ {
+ g_autoptr(IdePanelPosition) position = ide_page_get_position (IDE_PAGE (self->page));
+ IdePage *new_page = ide_page_create_split (IDE_PAGE (self->page));
+ IdeWorkspace *workspace = ide_widget_get_workspace (GTK_WIDGET (self->page));
+ guint column = 0;
+
+ ide_panel_position_get_column (position, &column);
+ ide_panel_position_set_column (position, column+1);
+ ide_panel_position_set_row (position, 0);
+
+ ide_workspace_add_grid_column (workspace, column+1);
+ ide_workspace_add_page (workspace, new_page, position);
+ }
+
+ if (g_str_equal (command, "^Ws") ||
+ g_str_equal (command, ":split"))
+ {
+ g_autoptr(IdePanelPosition) position = ide_page_get_position (IDE_PAGE (self->page));
+ IdePage *new_page = ide_page_create_split (IDE_PAGE (self->page));
+ IdeWorkspace *workspace = ide_widget_get_workspace (GTK_WIDGET (self->page));
+ guint row = 0;
+
+ ide_panel_position_get_row (position, &row);
+ ide_panel_position_set_row (position, row+1);
+
+ ide_workspace_add_page (workspace, new_page, position);
+ }
+
IDE_RETURN (FALSE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]