diff options
author | 2009-01-08 15:54:26 -0500 | |
---|---|---|
committer | 2009-01-08 15:54:26 -0500 | |
commit | 0194a626fcb17bcb037341fc6c2f586f54d26035 (patch) | |
tree | 9b54a08a6f30ce597b751190c113b934a3bb2b6d /core/ext/pm/modules_browser.lua | |
parent | 1267b118ffebf604639ca7a56660a1b4b69a2b85 (diff) | |
download | textadept-0194a626fcb17bcb037341fc6c2f586f54d26035.tar.gz textadept-0194a626fcb17bcb037341fc6c2f586f54d26035.zip |
Reformatted all C and Lua code to a single standard for each language.
Diffstat (limited to 'core/ext/pm/modules_browser.lua')
-rw-r--r-- | core/ext/pm/modules_browser.lua | 28 |
1 files changed, 15 insertions, 13 deletions
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 |