From 360026d0fd26d3e39b03e3b18beab51bbffb6578 Mon Sep 17 00:00:00 2001 From: Trenrod Date: Mon, 8 Jan 2024 23:28:41 +0100 Subject: [PATCH] Support for escaping insert mode with Ctrl+C Allow to use Ctrl+C to escape from insert mode. --- addons/godot-vim/godot-vim.gd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/godot-vim/godot-vim.gd b/addons/godot-vim/godot-vim.gd index 724971c..fe6441c 100644 --- a/addons/godot-vim/godot-vim.gd +++ b/addons/godot-vim/godot-vim.gd @@ -141,7 +141,8 @@ var command_keys_white_list : Dictionary = { "Ctrl+D": 1, "Ctrl+O": 1, "Ctrl+I": 1, - "Ctrl+R": 1 + "Ctrl+R": 1, + "Ctrl+C": 1 } @@ -1420,7 +1421,7 @@ class CommandDispatcher: vim.macro_manager.push_key(key) - if key_code == "Escape": + if key_code == "Escape" or key_code == "Ctrl+C": input_state.clear() vim.macro_manager.on_command_processed({}, vim.current.insert_mode) # From insert mode to normal mode, this marks the end of an edit command vim.current.enter_normal_mode()