diff options
author | 2013-09-15 14:41:34 -0400 | |
---|---|---|
committer | 2013-09-15 14:41:34 -0400 | |
commit | 9ccea9e562699b45ba830b8b1355571061580386 (patch) | |
tree | 0d908fa3c956254a2e3629a7398fa1c54c7863b3 /modules/textadept/session.lua | |
parent | c683ff20ef76c60cdf79df3c61f267dc3b7073ed (diff) | |
download | textadept-9ccea9e562699b45ba830b8b1355571061580386.tar.gz textadept-9ccea9e562699b45ba830b8b1355571061580386.zip |
Do not convert filenames to UTF-8; keep them in `_CHARSET`.
Diffstat (limited to 'modules/textadept/session.lua')
-rw-r--r-- | modules/textadept/session.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index 81023328..7d10ab46 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -40,13 +40,13 @@ M.MAX_RECENT_FILES = 10 -- @see DEFAULT_SESSION -- @name load function M.load(filename) + local dir = M.DEFAULT_SESSION:match('^.+[/\\]') or '' + local name = M.DEFAULT_SESSION:match('[^/\\]+$') or '' filename = filename or ui.dialog('fileselect', '--title', _L['Load Session'], - '--with-directory', - M.DEFAULT_SESSION:match('.+[/\\]') or '', - '--with-file', - M.DEFAULT_SESSION:match('[^/\\]+$') or '', - '--no-newline'):iconv(_CHARSET, 'UTF-8') + '--with-directory', dir, + '--with-file', name, + '--no-newline') if filename == '' then return end local not_found = {} local f = io.open(filename, 'rb') @@ -127,13 +127,13 @@ end) -- @see DEFAULT_SESSION -- @name save function M.save(filename) + local dir = M.DEFAULT_SESSION:match('^.+[/\\]') or '' + local name = M.DEFAULT_SESSION:match('[^/\\]+$') or '' filename = filename or ui.dialog('filesave', '--title', _L['Save Session'], - '--with-directory', - M.DEFAULT_SESSION:match('.+[/\\]') or '', - '--with-file', - M.DEFAULT_SESSION:match('[^/\\]+$') or '', - '--no-newline'):iconv(_CHARSET, 'UTF-8') + '--with-directory', dir, + '--with-file', name:iconv('UTF-8', _CHARSET), + '--no-newline') if filename == '' then return end local session = {} local buffer_line = "buffer: %d %d %d %s" -- anchor, cursor, line, filename |