vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 31f8ae1b0e6b114b87c02b1975ce6b09fec8d687 parent dc51955a9e57047ed085f84f10095e48acf0646f Author: Marc André Tanner <mat@brain-dump.org> Date: Sat, 29 Feb 2020 10:53:29 +0100 sam: fix spurious "file exists" warnings When initially opened with a non-existing file we would not correctly track the file's meta data resulting in spurious warnings upon subsequent writes. It is fixed by also saving the meta data for previously non-existing files with matching paths. Diffstat:
| M | sam.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sam.c b/sam.c @@ -1702,7 +1702,7 @@ static bool cmd_write(Vis *vis, Win *win, Command *cmd, const char *argv[], Sele file_name_set(file, path); same_file = true; } - if (same_file) + if (same_file || (!existing_file && strcmp(file->name, path) == 0)) file->stat = text_stat(text); vis_event_emit(vis, VIS_EVENT_FILE_SAVE_POST, file, path); free(path);