From 5b53aaa9b9c1603a679b59ee76ab3f85abb9fadf Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 30 Nov 2010 20:04:43 -0500 Subject: Added 'file_after_save' event. --- core/file_io.lua | 4 ++++ modules/lua/commands.lua | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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)
-- Called right before a file is saved to disk. -- - filename: the filename encoded in UTF-8. +-- * **file\_after\_save** (filename)
+-- Called right after a file is saved to disk. +-- - filename: the filename encoded in UTF-8. -- * **file\_saved_as** (filename)
-- 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 -- cgit v1.2.3