Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FelipeJz opened this issue Apr 14, 2024 · 0 comments
Open

Comments

@FelipeJz
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant