aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--main.c2
-rw-r--r--sam.c2
-rw-r--r--vis-core.h2
-rw-r--r--vis-lua.c6
-rw-r--r--vis-lua.h2
-rw-r--r--vis.c6
-rw-r--r--vis.h2
8 files changed, 12 insertions, 12 deletions
diff --git a/README.md b/README.md
index 484e634..47417af 100644
--- a/README.md
+++ b/README.md
@@ -590,7 +590,7 @@ At this time there exists no API stability guarantees.
- `start()`
- `quit()`
- `file_open(file)`
- - `file_save(file)`
+ - `file_save_post(file)` triggered *after* a successfull write
- `file_close(file)`
- `win_open(win)`
- `win_close(win)`
diff --git a/main.c b/main.c
index 5b61022..5b2a9bb 100644
--- a/main.c
+++ b/main.c
@@ -2203,7 +2203,7 @@ int main(int argc, char *argv[]) {
.vis_start = vis_lua_start,
.vis_quit = vis_lua_quit,
.file_open = vis_lua_file_open,
- .file_save = vis_lua_file_save,
+ .file_save_post = vis_lua_file_save_post,
.file_close = vis_lua_file_close,
.win_open = vis_lua_win_open,
.win_close = vis_lua_win_close,
diff --git a/sam.c b/sam.c
index 3e66420..37a1c80 100644
--- a/sam.c
+++ b/sam.c
@@ -1329,7 +1329,7 @@ static bool cmd_write(Vis *vis, Win *win, Command *cmd, const char *argv[], Curs
file_name_set(file, *name);
if (strcmp(file->name, *name) == 0)
file->stat = text_stat(text);
- vis_event_emit(vis, VIS_EVENT_FILE_SAVE, file);
+ vis_event_emit(vis, VIS_EVENT_FILE_SAVE_POST, file);
}
return true;
}
diff --git a/vis-core.h b/vis-core.h
index 6c1c577..6d79f18 100644
--- a/vis-core.h
+++ b/vis-core.h
@@ -191,7 +191,7 @@ enum VisEvents {
VIS_EVENT_START,
VIS_EVENT_QUIT,
VIS_EVENT_FILE_OPEN,
- VIS_EVENT_FILE_SAVE,
+ VIS_EVENT_FILE_SAVE_POST,
VIS_EVENT_FILE_CLOSE,
VIS_EVENT_WIN_OPEN,
VIS_EVENT_WIN_CLOSE,
diff --git a/vis-lua.c b/vis-lua.c
index 5b039ba..f134b83 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -128,7 +128,7 @@ void vis_lua_init(Vis *vis) { }
void vis_lua_start(Vis *vis) { }
void vis_lua_quit(Vis *vis) { }
void vis_lua_file_open(Vis *vis, File *file) { }
-void vis_lua_file_save(Vis *vis, File *file) { }
+void vis_lua_file_save_post(Vis *vis, File *file) { }
void vis_lua_file_close(Vis *vis, File *file) { }
void vis_lua_win_open(Vis *vis, Win *win) { }
void vis_lua_win_close(Vis *vis, Win *win) { }
@@ -1544,9 +1544,9 @@ void vis_lua_file_open(Vis *vis, File *file) {
lua_pop(L, 1);
}
-void vis_lua_file_save(Vis *vis, File *file) {
+void vis_lua_file_save_post(Vis *vis, File *file) {
lua_State *L = vis->lua;
- vis_lua_event_get(L, "file_save");
+ vis_lua_event_get(L, "file_save_post");
if (lua_isfunction(L, -1)) {
obj_ref_new(L, file, "vis.file");
pcall(vis, L, 1, 0);
diff --git a/vis-lua.h b/vis-lua.h
index 9732735..9d19a19 100644
--- a/vis-lua.h
+++ b/vis-lua.h
@@ -23,7 +23,7 @@ void vis_lua_init(Vis*);
void vis_lua_start(Vis*);
void vis_lua_quit(Vis*);
void vis_lua_file_open(Vis*, File*);
-void vis_lua_file_save(Vis*, File*);
+void vis_lua_file_save_post(Vis*, File*);
void vis_lua_file_close(Vis*, File*);
void vis_lua_win_open(Vis*, Win*);
void vis_lua_win_close(Vis*, Win*);
diff --git a/vis.c b/vis.c
index ed94f7d..341e6ed 100644
--- a/vis.c
+++ b/vis.c
@@ -58,7 +58,7 @@ bool vis_event_emit(Vis *vis, enum VisEvents id, ...) {
vis->event->vis_start(vis);
break;
case VIS_EVENT_FILE_OPEN:
- case VIS_EVENT_FILE_SAVE:
+ case VIS_EVENT_FILE_SAVE_POST:
case VIS_EVENT_FILE_CLOSE:
{
File *file = va_arg(ap, File*);
@@ -66,8 +66,8 @@ bool vis_event_emit(Vis *vis, enum VisEvents id, ...) {
break;
if (id == VIS_EVENT_FILE_OPEN && vis->event->file_open)
vis->event->file_open(vis, file);
- else if (id == VIS_EVENT_FILE_SAVE && vis->event->file_save)
- vis->event->file_save(vis, file);
+ else if (id == VIS_EVENT_FILE_SAVE_POST && vis->event->file_save_post)
+ vis->event->file_save_post(vis, file);
else if (id == VIS_EVENT_FILE_CLOSE && vis->event->file_close)
vis->event->file_close(vis, file);
break;
diff --git a/vis.h b/vis.h
index 2506c4a..2058669 100644
--- a/vis.h
+++ b/vis.h
@@ -32,7 +32,7 @@ typedef struct {
void (*vis_start)(Vis*);
void (*vis_quit)(Vis*);
void (*file_open)(Vis*, File*);
- void (*file_save)(Vis*, File*);
+ void (*file_save_post)(Vis*, File*);
void (*file_close)(Vis*, File*);
void (*win_open)(Vis*, Win*);
void (*win_close)(Vis*, Win*);