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
When I manipulate an open file through FTerm (like resetting the file via LazyGit, or simply echo test >> file.txt, I need to manually reload the file from disk when I close/toggle FTerm.
NeoVim usually checks for modifications on FocusGained events, and reloads the files automatically if autoread is active. E.g. when I call echo anothertest >> file.txt in a separate terminal, and then switch back to Vim, the file is reloaded automatically.
Is it possible for FTerm to issue the FocusGained event to trigger the check if the file has been modified when closing FTerm? Users can decide how to deal with this through the autoread option.
It looks like NeoVim has an API for that nvim_ui_set_focus since 0.8.0 (see this ticket).
The text was updated successfully, but these errors were encountered:
Small sidenote: when toggling FTerm, it is possible to include :checktime to check for file-changes and reload on demand. For example: vim.keymap.set("t", "<F7>", "<C-\\><C-n><CMD>lua require('FTerm').toggle()<CR>:checktime<CR>")
To trigger this behavior on exit (FTerm close), I can add a on_exit callback:
When I manipulate an open file through FTerm (like resetting the file via LazyGit, or simply
echo test >> file.txt
, I need to manually reload the file from disk when I close/toggle FTerm.NeoVim usually checks for modifications on
FocusGained
events, and reloads the files automatically ifautoread
is active. E.g. when I callecho anothertest >> file.txt
in a separate terminal, and then switch back to Vim, the file is reloaded automatically.Is it possible for FTerm to issue the
FocusGained
event to trigger the check if the file has been modified when closing FTerm? Users can decide how to deal with this through theautoread
option.It looks like NeoVim has an API for that
nvim_ui_set_focus
since 0.8.0 (see this ticket).The text was updated successfully, but these errors were encountered: