aboutsummaryrefslogtreecommitdiff
path: root/core/ext/pm
diff options
context:
space:
mode:
Diffstat (limited to 'core/ext/pm')
-rw-r--r--core/ext/pm/buffer_browser.lua7
-rw-r--r--core/ext/pm/ctags_browser.lua4
-rw-r--r--core/ext/pm/file_browser.lua3
-rw-r--r--core/ext/pm/macro_browser.lua2
-rw-r--r--core/ext/pm/modules_browser.lua3
-rw-r--r--core/ext/pm/project_browser.lua3
6 files changed, 9 insertions, 13 deletions
diff --git a/core/ext/pm/buffer_browser.lua b/core/ext/pm/buffer_browser.lua
index 0bac4818..e33c15aa 100644
--- a/core/ext/pm/buffer_browser.lua
+++ b/core/ext/pm/buffer_browser.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Buffer browser for the Textadept project manager.
@@ -16,12 +17,11 @@ end
function get_contents_for()
local contents = {}
for index, buffer in ipairs(textadept.buffers) do
- local filename =
- buffer.filename or buffer._type or textadept.locale.UNTITLED
index = string.format("%02i", index)
contents[index] = {
pixbuf = buffer.dirty and 'gtk-edit' or 'gtk-file',
- text = filename:match('[^/\\]+$')
+ text =
+ (buffer.filename or buffer._type or locale.UNTITLED):match('[^/\\]+$')
}
end
return contents
@@ -39,7 +39,6 @@ end
local ID = { NEW = 1, OPEN = 2, SAVE = 3, SAVEAS = 4, CLOSE = 5 }
function get_context_menu(selected_item)
- local locale = textadept.locale
return {
{ locale.PM_BROWSER_BUFFER_NEW, ID.NEW },
{ locale.PM_BROWSER_BUFFER_OPEN, ID.OPEN },
diff --git a/core/ext/pm/ctags_browser.lua b/core/ext/pm/ctags_browser.lua
index 3a4ce826..7039d1c4 100644
--- a/core/ext/pm/ctags_browser.lua
+++ b/core/ext/pm/ctags_browser.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- CTags Browser for the Textadept project manager.
@@ -110,7 +111,6 @@ end
-- of the parent being expanded.
function get_contents_for(full_path, expanding)
local ctags_file = full_path[1]:sub(7) -- ignore 'ctags:'
- local locale = textadept.locale
local f
if #ctags_file == 0 then
tags = {}
@@ -221,7 +221,7 @@ function perform_action(selected_item)
buffer:goto_line(line)
else
error(
- string.format(textadept.locale.PM_BROWSER_CTAGS_NOT_FOUND, item.text))
+ string.format(locale.PM_BROWSER_CTAGS_NOT_FOUND, item.text))
end
elseif item.line_num then
textadept.io.open(item.filepath)
diff --git a/core/ext/pm/file_browser.lua b/core/ext/pm/file_browser.lua
index 8aa6cf96..45c1db4c 100644
--- a/core/ext/pm/file_browser.lua
+++ b/core/ext/pm/file_browser.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- File browser for the Textadept project manager.
@@ -48,7 +49,6 @@ end
local ID = { CHANGE_DIR = 1, FILE_INFO = 2 }
function get_context_menu(selected_item)
- local locale = textadept.locale
return {
{ 'separator', 0 }, -- make it harder to click 'Change Directory' by mistake
{ locale.PM_BROWSER_FILE_CD, ID.CHANGE_DIR },
@@ -57,7 +57,6 @@ function get_context_menu(selected_item)
end
function perform_menu_action(menu_id, selected_item)
- local locale = textadept.locale
local filepath = table.concat(selected_item, '/')
if menu_id == ID.CHANGE_DIR then
textadept.pm.entry_text = filepath
diff --git a/core/ext/pm/macro_browser.lua b/core/ext/pm/macro_browser.lua
index 75e9e91f..32bd86ff 100644
--- a/core/ext/pm/macro_browser.lua
+++ b/core/ext/pm/macro_browser.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Macro browser for the Textadept project manager.
@@ -28,7 +29,6 @@ end
local ID = { DELETE = 1 }
function get_context_menu(selected_item)
- local locale = textadept.locale
return { { locale.PM_BROWSER_MACRO_DELETE, ID.DELETE } }
end
diff --git a/core/ext/pm/modules_browser.lua b/core/ext/pm/modules_browser.lua
index 174394a6..921dc455 100644
--- a/core/ext/pm/modules_browser.lua
+++ b/core/ext/pm/modules_browser.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Modules browser for the Textadept project manager.
@@ -113,7 +114,6 @@ local ID = {
}
function get_context_menu(selected_item)
- local locale = textadept.locale
return {
{ locale.PM_BROWSER_MODULE_NEW, ID.NEW },
{ locale.PM_BROWSER_MODULE_DELETE, ID.DELETE },
@@ -125,7 +125,6 @@ function get_context_menu(selected_item)
end
function perform_menu_action(menu_id, selected_item)
- local locale = textadept.locale
if menu_id == ID.NEW then
local status, module_name =
cocoa_dialog('standard-inputbox', {
diff --git a/core/ext/pm/project_browser.lua b/core/ext/pm/project_browser.lua
index b1609ad1..30616ef9 100644
--- a/core/ext/pm/project_browser.lua
+++ b/core/ext/pm/project_browser.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Browser template for the Textadept project manager.
@@ -84,7 +85,6 @@ local ID = {
--- Displays the project manager context menu.
function get_context_menu(selected_item)
- local locale = textadept.locale
return {
{ 'separator', 0 }, -- make it harder to click 'New Project' by mistake
{ locale.PM_BROWSER_PROJECT_NEW, ID.NEW },
@@ -101,7 +101,6 @@ function get_context_menu(selected_item)
end
function perform_menu_action(menu_id, selected_item)
- local locale = textadept.locale
if menu_id == ID.NEW then
-- Close all open files and prompt the user to save a project file.
if textadept.io.close_all() then