diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-02-23 12:09:43 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-02-23 12:09:43 +0100 |
| commit | f7f7009cdbfec8e79b90296e3de74e3b697916e8 (patch) | |
| tree | e9804c6cae69c3c8609196e3799aa0f88d13ff81 | |
| parent | 9d789adf02d80001bbd2f2af7f48526e08ccffe8 (diff) | |
| download | vis-f7f7009cdbfec8e79b90296e3de74e3b697916e8.tar.gz vis-f7f7009cdbfec8e79b90296e3de74e3b697916e8.tar.xz | |
sam: warn when attempting to write to an existing file
Add ! to override.
| -rw-r--r-- | sam.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1656,6 +1656,10 @@ static bool cmd_write(Vis *vis, Win *win, Command *cmd, const char *argv[], Sele vis_info_show(vis, "WARNING: file has been changed since reading it"); goto err; } + if (existing_file && !same_file) { + vis_info_show(vis, "WARNING: file exists"); + goto err; + } } if (!vis_event_emit(vis, VIS_EVENT_FILE_SAVE_PRE, file, path) && cmd->flags != '!') { |
