diff --git a/lua/harpoon/init.lua b/lua/harpoon/init.lua index ca09891..ae184ad 100644 --- a/lua/harpoon/init.lua +++ b/lua/harpoon/init.lua @@ -156,6 +156,7 @@ M.setup = function(config) global_settings = { ["save_on_toggle"] = false, ["save_on_change"] = true, + ["enter_on_sendcmd"] = false, }, }, expand_dir( c_config diff --git a/lua/harpoon/term.lua b/lua/harpoon/term.lua index 0c63699..71c2dd9 100644 --- a/lua/harpoon/term.lua +++ b/lua/harpoon/term.lua @@ -1,5 +1,6 @@ local harpoon = require("harpoon") local log = require("harpoon.dev").log +local global_config = harpoon.get_global_settings() local M = {} local terminals = {} @@ -66,6 +67,10 @@ M.sendCommand = function(idx, cmd, ...) cmd = harpoon.get_term_config().cmds[cmd] end + if global_config.enter_on_sendcmd then + cmd = cmd .. "\n" + end + if cmd then log.debug("sendCommand:", cmd) vim.api.nvim_chan_send(term_handle.term_id, string.format(cmd, ...))