Skip to content

Commit ef1bbff

Browse files
fix(commands): call ToggleTermSetName with count (#497)
fixes #496
1 parent 61e8ad3 commit ef1bbff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/toggleterm.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,17 @@ local function setup_commands()
436436
if no_count and no_name then
437437
get_subject_terminal(request_term_name)
438438
elseif no_name then
439-
request_term_name()
439+
local term = terms.get(opts.count)
440+
if not term then return end
441+
request_term_name(term)
440442
elseif no_count then
441443
get_subject_terminal(function(t) set_term_name(opts.args, t) end)
442444
else
443445
local term = terms.get(opts.count)
444446
if not term then return end
445447
set_term_name(opts.args, term)
446448
end
447-
end, { nargs = "?" })
449+
end, { nargs = "?", count = true })
448450
end
449451

450452
function M.setup(user_prefs)

0 commit comments

Comments
 (0)