From 3aa3f9f30142ea40dc20cb0aba462fdc5ac0da64 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 14 Oct 2010 21:09:46 -0400 Subject: Code formatting changes. --- modules/textadept/menu.lua | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'modules/textadept/menu.lua') 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 -- cgit v1.2.3