aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/file_io.lua4
-rw-r--r--modules/lua/commands.lua2
2 files changed, 5 insertions, 1 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index 574ea6a2..e053144c 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -39,6 +39,9 @@ module('io', package.seeall)
-- * **file\_before\_save** (filename) <br />
-- Called right before a file is saved to disk.
-- - filename: the filename encoded in UTF-8.
+-- * **file\_after\_save** (filename) <br />
+-- Called right after a file is saved to disk.
+-- - filename: the filename encoded in UTF-8.
-- * **file\_saved_as** (filename) <br />
-- Called when a file is saved under another filename.
-- - filename: the other filename encoded in UTF-8.
@@ -239,6 +242,7 @@ local function save(buffer)
buffer:set_save_point()
buffer.modification_time = lfs.attributes(filename).modification
if buffer._type then buffer._type = nil end
+ events.emit('file_after_save', buffer.filename)
end
-- LuaDoc is in core/.buffer.luadoc.
diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua
index 1d39bd2e..e8889a5b 100644
--- a/modules/lua/commands.lua
+++ b/modules/lua/commands.lua
@@ -133,7 +133,7 @@ function goto_required()
end
end
-events.connect('file_before_save',
+events.connect('file_after_save',
function() -- show syntax errors as annotations
if buffer:get_lexer() == 'lua' then
local buffer = buffer