You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Such as if I use hjkl my cursor moves inside the original window, but if I use a keymap that does "<cmd>q!<CR>" it closes the terminal window.
The above is what happens on the first iteration. On the second iteration, the terminal window opens, but the terminal buffer is inserted into my original "document" buffer window instead of its own.
Alternatively: when manually running :q
The first iteration goes as expected: the terminal opens, my cursor is still in the window, I type :q, my original window closes.
The second iteration however goes exactly as described above.
Expected Behavior
Repeated uses of the commands should open new terminal windows when needed, and the terminal windows should always go to those buffers.
It seems that even though the cursor doesn't switch windows, the keymap capture does, this should not happen.
Steps To Reproduce
Lazy lua module:
localfunctionmake_opts(_, opts)
localcustom_opts= {
open_mapping=[[<C-\>]],
}
returnvim.tbl_deep_extend(
"force",
opts,
custom_opts
)
endlocalfunctionmake_keymaps()
return {
{
"<leader>te",
"<cmd>ToggleTermSendCurrentLine 8 <CR>",
desc="Execute current line in a terminal.",
},
{
"<leader>te",
"<cmd>ToggleTermSendVisualLines 8 <CR>",
mode="v",
desc="Execute selected lines in a terminal.",
},
}
endreturn {
"akinsho/toggleterm.nvim",
lazy=false,
keys=make_keymaps(),
opts=make_opts,
}
Sample line to execute:
ls
Environment
OS:
$ uname -a
Linux arch 6.4.1-arch2-1 #1 SMP PREEMPT_DYNAMIC Tue, 04 Jul 2023 08:39:40 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
louis-vinchon
changed the title
[BUG] Odd focus / cursor behavior with ToggleTermSendCurrentLine and ToggleTermSendVisualLines
[BUG] keymap focus / cursor desync with ToggleTermSendCurrentLine and ToggleTermSendVisualLines
Jul 8, 2023
@louis-vinchon the exact same comment I mentioned in the other issue applies here as well. This issues sounds quite strange though in a way that deviates from how neovim works at all tbh i.e. You can't really have focus in a different place from the cursor AFAIK. But in either case TLDR is PRs welcome but essentially I leave REPLish functionality to users willing to put in the work. It's either that or deprecating all of it to reduce this dimension of issues.
Is there an existing issue for this?
Current Behavior
When opening a terminal with:
ToggleTermSendCurrentLine
ToggleTermSendVisualLines
The terminal opens but:
Such as if I use
hjkl
my cursor moves inside the original window, but if I use a keymap that does"<cmd>q!<CR>"
it closes the terminal window.The above is what happens on the first iteration. On the second iteration, the terminal window opens, but the terminal buffer is inserted into my original "document" buffer window instead of its own.
Alternatively: when manually running
:q
The first iteration goes as expected: the terminal opens, my cursor is still in the window, I type
:q
, my original window closes.The second iteration however goes exactly as described above.
Expected Behavior
Repeated uses of the commands should open new terminal windows when needed, and the terminal windows should always go to those buffers.
It seems that even though the cursor doesn't switch windows, the keymap capture does, this should not happen.
Steps To Reproduce
Lazy lua module:
Sample line to execute:
Environment
$ uname -a Linux arch 6.4.1-arch2-1 #1 SMP PREEMPT_DYNAMIC Tue, 04 Jul 2023 08:39:40 +0000 x86_64 GNU/Linux
Anything else?
No response
The text was updated successfully, but these errors were encountered: