Skip to content

Commit 48af865

Browse files
authored
Merge pull request #240 from etrnal70/respect-default
Respect user's current toggleterm config
2 parents fc6d524 + 15f2efd commit 48af865

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lua/asyncrun/toggleterm.lua

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
local terminal = require("toggleterm.terminal").Terminal
2-
3-
local M = {
4-
settings = {
5-
mapping = "<leader>tt",
6-
},
7-
}
2+
local config = require("toggleterm.config")
83

94
function M.reset()
105
if M._asyncrun_term ~= nil then
@@ -30,9 +25,6 @@ function M.runner(opts, mapping)
3025
dir = opts.cwd,
3126
close_on_exit = false,
3227
hidden = true,
33-
on_open = function(_)
34-
vim.cmd("startinsert!")
35-
end,
3628
})
3729

3830
function M._asyncrun_term_toggle()
@@ -42,7 +34,7 @@ function M.runner(opts, mapping)
4234
if not opts.silent then
4335
M._asyncrun_term_toggle()
4436
end
45-
M._asyncrun_mapping = mapping or M.settings.mapping
37+
M._asyncrun_mapping = mapping or config.get("open_mapping")
4638
if M._asyncrun_mapping then
4739
vim.api.nvim_set_keymap(
4840
"n",

0 commit comments

Comments
 (0)