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

Error executing lua: ...site/pack/packer/start/FTerm.nvim/lua/FTerm/terminal.lua:109: Window was closed immediately #55

Open
nyngwang opened this issue Jan 17, 2022 · 5 comments

Comments

@nyngwang
Copy link

nyngwang commented Jan 17, 2022

How to Reproduce:

  1. Install plugin called fzf-lua
  2. Open any one of its floating windows, e.g. FzfLua buffers
  3. Execute cmd :lua require("FTerm").toggle()

Friendly linked to the error line:

local win = A.nvim_open_win(buf, true, {

@nyngwang
Copy link
Author

nyngwang commented Jan 17, 2022

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.

@nyngwang nyngwang reopened this Jan 17, 2022
@nyngwang
Copy link
Author

I hope this can be taken into consideration. So users won't have to solve it themselves painly.

@numToStr
Copy link
Owner

I'll investigate what is causing this.

@nyngwang
Copy link
Author

nyngwang commented Jan 17, 2022

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 })

@marcoSven
Copy link

Friendly linked to the error line:

local win = A.nvim_open_win(buf, true, {

I am running into the same issue with Telescope.

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

3 participants