From 9ccea9e562699b45ba830b8b1355571061580386 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 15 Sep 2013 14:41:34 -0400 Subject: Do not convert filenames to UTF-8; keep them in `_CHARSET`. --- modules/textadept/session.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'modules/textadept/session.lua') 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 -- cgit v1.2.3