From 0194a626fcb17bcb037341fc6c2f586f54d26035 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 8 Jan 2009 15:54:26 -0500 Subject: Reformatted all C and Lua code to a single standard for each language. --- core/ext/pm/modules_browser.lua | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'core/ext/pm/modules_browser.lua') diff --git a/core/ext/pm/modules_browser.lua b/core/ext/pm/modules_browser.lua index 95a5bd9f..4fc97206 100644 --- a/core/ext/pm/modules_browser.lua +++ b/core/ext/pm/modules_browser.lua @@ -123,15 +123,17 @@ end function perform_menu_action(menu_item, menu_id, selected_item) local locale = textadept.locale if menu_id == ID.NEW then - local status, module_name = cocoa_dialog( 'standard-inputbox', { - ['title'] = locale.PM_BROWSER_MODULE_NEW_TITLE, - ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_INFO_TEXT - } ):match('^(%d)%s+([^\n]+)%s+$') + local status, module_name = + cocoa_dialog('standard-inputbox', { + ['title'] = locale.PM_BROWSER_MODULE_NEW_TITLE, + ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_INFO_TEXT + }):match('^(%d)%s+([^\n]+)%s+$') if status ~= '1' then return end - local status, lang_name = cocoa_dialog( 'standard-inputbox', { - ['title'] = locale.PM_BROWSER_MODULE_NEW_LANG_TITLE, - ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_LANG_INFO_TEXT - } ):match('^(%d)%s+([^\n]+)%s+$') + local status, lang_name = + cocoa_dialog('standard-inputbox', { + ['title'] = locale.PM_BROWSER_MODULE_NEW_LANG_TITLE, + ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_LANG_INFO_TEXT + }):match('^(%d)%s+([^\n]+)%s+$') if status ~= '1' then return end local module_dir = _HOME..'/modules/'..module_name if lfs.mkdir(module_dir) then @@ -151,22 +153,22 @@ function perform_menu_action(menu_item, menu_id, selected_item) f:write(out) f:close() else - cocoa_dialog( 'ok-msgbox', { + cocoa_dialog('ok-msgbox', { ['text'] = locale.PM_BROWSER_MODULE_NEW_ERROR, ['informative-text'] = locale.PM_BROWSER_MODULE_NEW_ERROR_TEXT, ['no-cancel'] = true - } ) + }) return end elseif menu_id == ID.DELETE then local module_name = selected_item[2] - if cocoa_dialog( 'yesno-msgbox', { + if cocoa_dialog('yesno-msgbox', { ['text'] = locale.PM_BROWSER_MODULE_DELETE_TITLE, ['informative-text'] = - string.format( locale.PM_BROWSER_MODULE_DELETE_TEXT, module_name ), + string.format(locale.PM_BROWSER_MODULE_DELETE_TEXT, module_name), ['no-cancel'] = true, ['no-newline'] = true - } ) == '1' then + }) == '1' then local function remove_directory(dirpath) for name in lfs.dir(dirpath) do if not name:match('^%.%.?$') then os.remove(dirpath..'/'..name) end -- cgit v1.2.3