diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-02-29 10:53:29 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-02-29 12:37:15 +0100 |
| commit | dc5c1166abc29b6634649eb9872908acdc18c52e (patch) | |
| tree | 25b00698ce5e03d6e541c6e88500ce4143badd71 | |
| parent | bdfea7e6c1d1a7ad5b3d479bb2c30c7e610f2ee6 (diff) | |
| download | vis-dc5c1166abc29b6634649eb9872908acdc18c52e.tar.gz vis-dc5c1166abc29b6634649eb9872908acdc18c52e.tar.xz | |
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.
| -rw-r--r-- | sam.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |
