voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.47k stars 78 forks source link

Error if file is renamed #365

Open mcmillion opened 2 years ago

mcmillion commented 2 years ago

Before reporting

Environment

If you are using neovim, just run :checkhealth floaterm and post the content

below.


floaterm: health#floaterm#check
========================================================================
## common
  - INFO: Platform: macos
  - INFO: Nvim: NVIM v0.7.0
  - INFO: Plugin: e3f2d94

## terminal
  - OK: Terminal emulator is available

## floating
  - OK: Floating window is available

Configurations related to vim-floaterm in vimrc(i.e. g:floaterm_xxx):

vim.g.floaterm_title = ""
vim.g.floaterm_borderchars = "▔▕▁▏🭽🭾🭿🭼"
vim.g.floaterm_width = 0.80
vim.g.floaterm_height = 0.85

Describe your question, feature request, or bug.

Closing a terminal after renaming the file of the buffer that was open causes an error.

I'm originally running into this issue with lf.vim, but it happens even if you disable lf.vim and just use :FloatermNew lf or just :FloatermNew and manually rename the file.

I get that this is probably mostly vim-related, but is there a way around this error? The new file gets opened in the correct buffer just fine, but that error is still there.

Steps to reproduce

1.) Have a buffer open 2.) Open a new terminal with :FloatermNew 3.) Rename the file in the current buffer 4.) Close terminal

Actual behaviour

Error:

Error detected while processing function <SNR>110_on_floaterm_close[20]..floaterm#window#hide:                                                                                                                                                                                               
line   24: 
E211: File "path/to/old/filename" no longer available 

Expected behaviour

The buffer just closes