diff options
author | 2009-07-08 21:41:01 -0400 | |
---|---|---|
committer | 2009-07-08 21:41:01 -0400 | |
commit | 741d7e87d67d265fd0096b779d1e471172b2bccb (patch) | |
tree | 909bd4d16ee84e05c0a4619499a1c3d6739e5ecd /core/ext | |
parent | a8e87e8efd47676ff0f04fbfba14be189b169ebb (diff) | |
download | textadept-741d7e87d67d265fd0096b779d1e471172b2bccb.tar.gz textadept-741d7e87d67d265fd0096b779d1e471172b2bccb.zip |
Better session management.
Can load and save from the menu now as well.
Diffstat (limited to 'core/ext')
-rw-r--r-- | core/ext/menu.lua | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/core/ext/menu.lua b/core/ext/menu.lua index c78b36ed..6549cbfd 100644 --- a/core/ext/menu.lua +++ b/core/ext/menu.lua @@ -361,28 +361,30 @@ local actions = { [ID.LOAD_SESSION] = { function() local utf8_filename = - cocoa_dialog('fileselect', { - title = l.MENU_LOAD_SESSION_TITLE, - ['with-directory'] = (textadept.session_file or ''):match('.+[/\\]'), - ['with-file'] = (textadept.session_file or ''):match('[^/\\]+$'), - ['no-newline'] = true - }) + t.dialog('fileselect', + '--title', l.MENU_LOAD_SESSION_TITLE, + '--with-directory', + (textadept.session_file or ''):match('.+[/\\]') or '', + '--with-file', + (textadept.session_file or ''):match('[^/\\]+$') or '', + '--no-newline') if #utf8_filename > 0 then - _m.textadept.session.load(t.iconv(utf8_filename, _CHARSET, 'UTF-8')) + t.io.load_session(t.iconv(utf8_filename, _CHARSET, 'UTF-8')) end end }, [ID.SAVE_SESSION] = { function() local utf8_filename = - cocoa_dialog('filesave', { - title = l.MENU_SAVE_SESSION_TITLE, - ['with-directory'] = (textadept.session_file or ''):match('.+[/\\]'), - ['with-file'] = (textadept.session_file or ''):match('[^/\\]+$'), - ['no-newline'] = true - }) + t.dialog('filesave', + '--title', l.MENU_SAVE_SESSION_TITLE, + '--with-directory', + (textadept.session_file or ''):match('.+[/\\]') or '', + '--with-file', + (textadept.session_file or ''):match('[^/\\]+$') or '', + '--no-newline') if #utf8_filename > 0 then - _m.textadept.session.save(t.iconv(utf8_filename, _CHARSET, 'UTF-8')) + t.io.save_session(t.iconv(utf8_filename, _CHARSET, 'UTF-8')) end end }, |