aboutsummaryrefslogtreecommitdiff
path: root/core/ext/pm/modules_browser.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/ext/pm/modules_browser.lua')
-rw-r--r--core/ext/pm/modules_browser.lua28
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