mirror of
https://github.com/neovim/neovim.git
synced 2026-07-21 08:31:47 +00:00
feat: ":write!" skips "file changed" warning #18665
Problem: Cannot opt-out of "WARNING: The file has been changed since reading it!!!", even with ":write!". Solution: Change ":write!" to skip the warning. closes #7270
This commit is contained in:
committed by
GitHub
parent
c7cf1232a7
commit
2a3cb0893b
@@ -2536,8 +2536,8 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
|
||||
goto fail;
|
||||
}
|
||||
|
||||
// Check if the timestamp hasn't changed since reading the file.
|
||||
if (overwriting) {
|
||||
// If 'forceit' is false, check if the timestamp hasn't changed since reading the file.
|
||||
if (overwriting && !forceit) {
|
||||
retval = check_mtime(buf, &file_info_old);
|
||||
if (retval == FAIL) {
|
||||
goto fail;
|
||||
|
||||
Reference in New Issue
Block a user