Open nyngwang opened 2 years ago
For anyone who is reading try this modified keymap:
vim.keymap.set({'n', 't'}, '<M-Tab>', function ()
if (vim.api.nvim_win_get_config(0).relative ~= '') then
vim.api.nvim_input('<ESC>')
end
require('FTerm').toggle()
end, NOREF_NOERR_TRUNC)
the little non-harmful drawback is that you will need to press the keymap twice to close the existing floating window and open the terminal.
I hope this can be taken into consideration. So users won't have to solve it themselves painly.
I'll investigate what is causing this.
I'll investigate what is causing this.
@numToStr Thanks :)
For anyone who is reading try this modified keymap:
vim.keymap.set({'n', 't'}, '<M-Tab>', function () if (vim.api.nvim_win_get_config(0).relative ~= '') then vim.api.nvim_input('<ESC>') end require('FTerm').toggle() end, NOREF_NOERR_TRUNC)
And I just found a much simpler solution hours ago. But this one doesn't facilitate the newest syntax. It still need to use <cmd>...
, which is what I don't like:
vim.keymap.set({'n', 't'}, '<M-Tab>', "<cmd>silent! lua require('FTerm').toggle()<CR>", { nowait=true, noremap=true, silent=true })
![]()
Friendly linked to the error line:
I am running into the same issue with Telescope.
How to Reproduce:
FzfLua buffers
:lua require("FTerm").toggle()
Friendly linked to the error line: https://github.com/numToStr/FTerm.nvim/blob/eabb65f23ba48ec9e8abb9a2514f99b77b3bc6f2/lua/FTerm/terminal.lua#L109