diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-09-09 15:14:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-09 15:14:26 -0400 |
| commit | ac167f943a905669b29f337f18d22a1efefeca92 (patch) | |
| tree | 6e7b882aac5edab9c01da1974d9e1b75bfa1330a /runtime/lua/vim/loader.lua | |
| parent | a55f134ee305ebf3cb75149025c5e75f5e2090e0 (diff) | |
| download | rneovim-ac167f943a905669b29f337f18d22a1efefeca92.tar.gz rneovim-ac167f943a905669b29f337f18d22a1efefeca92.tar.bz2 rneovim-ac167f943a905669b29f337f18d22a1efefeca92.zip | |
fix(terminal): check file timestamps on terminal-job exit #41814
Problem:
When a `:!` command runs, file timestamps are checked and W12 or
`FileChangedShell` is triggered. But not when a `:terminal` job exits.
Only `enter_buffer()` checks, so whether you get the W12 warning depends
on how you happen to return to the file: `:term` works, `:tabnew | term`
does not.
echo foo > testfile
nvim --clean testfile
" Edit the buffer, don't save it.
:!mv testfile testfile2
:tabnew | term sh
touch testfile2 && mv testfile2 testfile
exit
'autoread' is defeated because `:!mv` deletes the file, so
`should_watch()` fails and the watcher stops. `ensure_watcher()` only
re-runs on `BufReadPost`/`BufWritePost`/`OptionSet`, so nothing watches
the file when the terminal moves it back.
Solution:
Set `need_check_timestamps` on terminal-job exit, same as `:!cmd`
(`os_shell`).
Diffstat (limited to 'runtime/lua/vim/loader.lua')
0 files changed, 0 insertions, 0 deletions