diff options
author | 2010-10-14 21:09:46 -0400 | |
---|---|---|
committer | 2010-10-14 21:09:46 -0400 | |
commit | 3aa3f9f30142ea40dc20cb0aba462fdc5ac0da64 (patch) | |
tree | 4627624ca45905b494e212a74ca3f5f72de7248d /modules/textadept/menu.lua | |
parent | 8d29321eeba9f77dcd3aaaa9fd504d5f736463e7 (diff) | |
download | textadept-3aa3f9f30142ea40dc20cb0aba462fdc5ac0da64.tar.gz textadept-3aa3f9f30142ea40dc20cb0aba462fdc5ac0da64.zip |
Code formatting changes.
Diffstat (limited to 'modules/textadept/menu.lua')
-rw-r--r-- | modules/textadept/menu.lua | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index af71519d..589c3205 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -345,14 +345,14 @@ local actions = { [ID.CLOSE_ALL] = { io.close_all }, [ID.LOAD_SESSION] = { function() - local utf8_filename = - gui.dialog('fileselect', - '--title', l.MENU_LOAD_SESSION_TITLE, - '--with-directory', - (_SESSIONFILE or ''):match('.+[/\\]') or '', - '--with-file', - (_SESSIONFILE or ''):match('[^/\\]+$') or '', - '--no-newline') + local session_file = _SESSIONFILE or '' + local utf8_filename = gui.dialog('fileselect', + '--title', l.MENU_LOAD_SESSION_TITLE, + '--with-directory', + session_file:match('.+[/\\]') or '', + '--with-file', + session_file:match('[^/\\]+$') or '', + '--no-newline') if #utf8_filename > 0 then _m.textadept.session.load(utf8_filename:iconv(_CHARSET, 'UTF-8')) end @@ -360,14 +360,14 @@ local actions = { }, [ID.SAVE_SESSION] = { function() - local utf8_filename = - gui.dialog('filesave', - '--title', l.MENU_SAVE_SESSION_TITLE, - '--with-directory', - (_SESSIONFILE or ''):match('.+[/\\]') or '', - '--with-file', - (_SESSIONFILE or ''):match('[^/\\]+$') or '', - '--no-newline') + local session_file = _SESSIONFILE or '' + local utf8_filename = gui.dialog('filesave', + '--title', l.MENU_SAVE_SESSION_TITLE, + '--with-directory', + session_file:match('.+[/\\]') or '', + '--with-file', + session_file:match('[^/\\]+$') or '', + '--no-newline') if #utf8_filename > 0 then _m.textadept.session.save(utf8_filename:iconv(_CHARSET, 'UTF-8')) end @@ -499,8 +499,7 @@ events.connect('menu_clicked', function(menu_id) local active_table = actions[menu_id] if menu_id >= ID.LEXER_START and menu_id < ID.LEXER_START + 99 then - active_table = - { set_lexer, lexer_menu[menu_id - ID.LEXER_START + 1][1] } + active_table = { set_lexer, lexer_menu[menu_id - ID.LEXER_START + 1][1] } end local f, args if active_table and #active_table > 0 then |