aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/bookmarks.lua1
-rw-r--r--modules/textadept/editing.lua2
-rw-r--r--modules/textadept/lsnippets.lua5
-rw-r--r--modules/textadept/macros.lua5
-rw-r--r--modules/textadept/mlines.lua3
-rw-r--r--modules/textadept/run.lua7
-rw-r--r--modules/textadept/snippets.lua5
7 files changed, 17 insertions, 11 deletions
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index dad9eaad..075f51fd 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Bookmarks for the textadept module.
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 1631ca59..a7c0e674 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Editing commands for the textadept module.
@@ -263,7 +264,6 @@ end
-- @param line Optional line number to go to.
function goto_line(line)
local buffer = buffer
- local locale = textadept.locale
if not line then
line =
cocoa_dialog('standard-inputbox', {
diff --git a/modules/textadept/lsnippets.lua b/modules/textadept/lsnippets.lua
index c0cfab20..b8499fbb 100644
--- a/modules/textadept/lsnippets.lua
+++ b/modules/textadept/lsnippets.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Provides Lua-centric snippets for Textadept.
@@ -352,8 +353,8 @@ function show_style()
local style_num = buffer.style_at[buffer.current_pos]
local style = buffer:get_style_name(style_num)
local text =
- string.format(textadept.locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer,
- style, style_num)
+ string.format(locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer, style,
+ style_num)
buffer:call_tip_show(buffer.current_pos, text)
end
diff --git a/modules/textadept/macros.lua b/modules/textadept/macros.lua
index 62f9f972..80a89d0f 100644
--- a/modules/textadept/macros.lua
+++ b/modules/textadept/macros.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Support for recording, saving, and playing macros for the textadept module.
@@ -41,7 +42,7 @@ local recording = false
local function macro_notification(msg, wParam, lParam)
if recording then
current[#current + 1] = { msg, wParam or 0, lParam or 0 }
- textadept.statusbar_text = textadept.locale.M_TEXTADEPT_MACRO_RECORDING
+ textadept.statusbar_text = locale.M_TEXTADEPT_MACRO_RECORDING
end
end
textadept.events.add_handler('macro_record', macro_notification)
@@ -65,7 +66,6 @@ function stop_recording()
if not recording then return end
buffer:stop_record()
recording = false
- local locale = textadept.locale
local ret, macro_name =
cocoa_dialog('standard-inputbox', {
['informative-text'] = locale.M_TEXTADEPT_MACRO_SAVE_TITLE,
@@ -101,7 +101,6 @@ end
-- is prompted to choose one from a list of available macros.
function play(macro_name)
if not macro_name then
- local locale = textadept.locale
local macros = {}
for name, _ in pairs(list) do macros[#macros + 1] = name end
if #macros > 0 then
diff --git a/modules/textadept/mlines.lua b/modules/textadept/mlines.lua
index ce1997ce..2cd1cb93 100644
--- a/modules/textadept/mlines.lua
+++ b/modules/textadept/mlines.lua
@@ -1,5 +1,8 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+local textadept = _G.textadept
+local locale = _G.locale
+
---
-- Multiple line editing for the textadept module.
-- There are several option variables used:
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 147c8055..8923eeb6 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Module for running/executing source files.
@@ -179,8 +180,8 @@ local error_details = {
-- @param line_num The line double-clicked.
-- @see error_details
function goto_error(pos, line_num)
- local locale = textadept.locale
- if buffer._type == locale.MESSAGE_BUFFER or buffer._type == 'error_buffer' then
+ local type = buffer._type
+ if type == locale.MESSAGE_BUFFER or type == locale.ERROR_BUFFER then
line = buffer:get_line(line_num)
for _, error_detail in pairs(error_details) do
local captures = { line:match(error_detail.pattern) }
@@ -194,7 +195,7 @@ function goto_error(pos, line_num)
if msg then buffer:call_tip_show(buffer.current_pos, msg) end
else
error(string.format(
- textadept.locale.M_TEXTADEPT_RUN_FILE_DOES_NOT_EXIST, filename))
+ locale.M_TEXTADEPT_RUN_FILE_DOES_NOT_EXIST, filename))
end
break
end
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index d9d40f71..b0fad9d3 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Provides Textmate-like snippets for the textadept module.
@@ -368,8 +369,8 @@ function show_scope()
local lexer = buffer:get_lexer_language()
local scope = buffer.style_at[buffer.current_pos]
local text =
- string.format(textadept.locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer,
- style, style_num)
+ string.format(locale.M_TEXTADEPT_SNIPPETS_SHOW_STYLE, lexer, style,
+ style_num)
buffer:call_tip_show(buffer.current_pos, text)
end