diff options
author | 2010-11-30 20:04:43 -0500 | |
---|---|---|
committer | 2010-11-30 20:04:43 -0500 | |
commit | 5b53aaa9b9c1603a679b59ee76ab3f85abb9fadf (patch) | |
tree | a9608f4d5b270d4717e4816a0be10632dc47d585 | |
parent | c7b543e79b41d9a983cc89e264acd0472d09dc92 (diff) | |
download | textadept-5b53aaa9b9c1603a679b59ee76ab3f85abb9fadf.tar.gz textadept-5b53aaa9b9c1603a679b59ee76ab3f85abb9fadf.zip |
Added 'file_after_save' event.
-rw-r--r-- | core/file_io.lua | 4 | ||||
-rw-r--r-- | modules/lua/commands.lua | 2 |
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 |