From bdb0898bf702f58857a599ab0d7eeb329324c8bd Mon Sep 17 00:00:00 2001 From: Mohu Date: Sun, 1 Oct 2023 05:09:15 +0800 Subject: [PATCH] fix(ToggleTerm/keymap): respect `v:count` (#1012) * fix(keymap): be able to open multiple terminals according to toggleterm default behavior. Signed-off-by: ayamir * fix(toggleterm/keymap): `` missing direction spec * fixup! fix(toggleterm/keymap): `` missing direction spec --------- Signed-off-by: ayamir Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/keymap/tool.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index 21aa0d560..0f5a8fa29 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -23,7 +23,7 @@ local plug_map = { -- Plugin: toggleterm ["t|"] = map_cmd([[]]):with_noremap():with_silent(), -- switch to normal mode in terminal. ["t|jk"] = map_cmd([[]]):with_noremap():with_silent(), -- switch to normal mode in terminal. - ["n|"] = map_cr([[execute v:count . "ToggleTerm direction=horizontal"]]) + ["n|"] = map_cr("ToggleTerm direction=horizontal") :with_noremap() :with_silent() :with_desc("terminal: Toggle horizontal"), @@ -32,7 +32,7 @@ local plug_map = { :with_silent() :with_desc("terminal: Toggle horizontal"), ["t|"] = map_cmd("ToggleTerm"):with_noremap():with_silent():with_desc("terminal: Toggle horizontal"), - ["n|"] = map_cr([[execute v:count . "ToggleTerm direction=vertical"]]) + ["n|"] = map_cr("ToggleTerm direction=vertical") :with_noremap() :with_silent() :with_desc("terminal: Toggle vertical"), @@ -41,7 +41,7 @@ local plug_map = { :with_silent() :with_desc("terminal: Toggle vertical"), ["t|"] = map_cmd("ToggleTerm"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"), - ["n|"] = map_cr([[execute v:count . "ToggleTerm direction=vertical"]]) + ["n|"] = map_cr("ToggleTerm direction=vertical") :with_noremap() :with_silent() :with_desc("terminal: Toggle vertical"), @@ -50,10 +50,7 @@ local plug_map = { :with_silent() :with_desc("terminal: Toggle vertical"), ["t|"] = map_cmd("ToggleTerm"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"), - ["n|"] = map_cr([[execute v:count . "ToggleTerm direction=float"]]) - :with_noremap() - :with_silent() - :with_desc("terminal: Toggle float"), + ["n|"] = map_cr("ToggleTerm direction=float"):with_noremap():with_silent():with_desc("terminal: Toggle float"), ["i|"] = map_cmd("ToggleTerm direction=float") :with_noremap() :with_silent()