akinsho / toggleterm.nvim

A neovim lua plugin to help easily manage multiple terminal windows
GNU General Public License v3.0
4.06k stars 170 forks source link

Toggleterm adds cursor line number when using count modifier to set the id #569

Open FelipeJz opened 3 months ago

FelipeJz commented 3 months ago

I get this weird behavior when trying to manage multiple terminal instances using keymaps.

vim.keymap.set("n", "<C-t>", ":ToggleTerm size=20 direction=vertical<CR>", {noremap = true})

It opens the terminal#1, all fine. It works perfectly with no count modifier. But when i tap 4<C-t> while the cursor is in line 30, it opens the terminal#34 instead of terminal#4. The only way back is moving the cursor to line 1.

Using the keymap without the return i noticed the value being passed to the command is this:

.,.+4ToggleTerm size=20 direction=vertical

I guess this points to the current line number.

How can i avoid this? Any help with this will be really appreciated! Thanks