diff options
author | 2011-09-26 19:40:56 -0400 | |
---|---|---|
committer | 2011-09-26 19:40:56 -0400 | |
commit | 914da964175fad16339a1be68bd0a4bde13abaf0 (patch) | |
tree | e065efbd69d26f4e6f76fa209f031028ffa99c64 /core | |
parent | 8bcdb16e18641e1cea08ebb614d70d98a3c27426 (diff) | |
download | textadept-914da964175fad16339a1be68bd0a4bde13abaf0.tar.gz textadept-914da964175fad16339a1be68bd0a4bde13abaf0.zip |
Change directory on io.open_file() or buffer:save_as(); core/file_io.lua
Diffstat (limited to 'core')
-rw-r--r-- | core/file_io.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index de0e793e..bb5f452e 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -162,6 +162,7 @@ function open_file(utf8_filenames) if file == utf8_filename then table.remove(recent_files, i) break end end table.insert(recent_files, 1, utf8_filename) + lfs.chdir(utf8_filename:iconv('UTF-8', _CHARSET):match('.+[/\\]')) end end @@ -241,6 +242,7 @@ local function save_as(buffer, utf8_filename) buffer.filename = utf8_filename buffer:save() events.emit(events.FILE_SAVED_AS, utf8_filename) + lfs.chdir(utf8_filename:iconv('UTF-8', _CHARSET):match('.+[/\\]')) end end |