vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 6679031c1368c760b6af7790ec3615416403fc91
parent 50de4d9be29f6bc761bf81619d319f16913597fb
Author: Christian Hesse <mail@eworm.de>
Date:   Wed,  5 Oct 2016 09:55:53 +0200

sam: show error message on failed write

Diffstat:
Msam.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sam.c b/sam.c @@ -1111,8 +1111,10 @@ static bool cmd_write(Vis *vis, Win *win, Command *cmd, const char *argv[], Curs } TextSave *ctx = text_save_begin(text, *name); - if (!ctx) + if (!ctx) { + vis_info_show(vis, "Can't write `%s': %s", *name, strerror(errno)); return false; + } bool failure = false; @@ -1134,7 +1136,7 @@ static bool cmd_write(Vis *vis, Win *win, Command *cmd, const char *argv[], Curs } if (failure || !text_save_commit(ctx)) { - vis_info_show(vis, "Can't write `%s'", *name); + vis_info_show(vis, "Can't write `%s': %s", *name, strerror(errno)); return false; }