aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/bookmarks.lua4
-rw-r--r--modules/textadept/editing.lua5
-rw-r--r--modules/textadept/lsnippets.lua2
-rw-r--r--modules/textadept/macros.lua7
-rw-r--r--modules/textadept/snippets.lua2
5 files changed, 17 insertions, 3 deletions
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index 8bcd3e7d..80853c29 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -1,5 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+local textadept = _G.textadept
+
---
-- Bookmarks for the textadept module.
-- There are several option variables used:
@@ -48,6 +50,7 @@ end
---
-- Goes to the next bookmark in the current buffer.
function goto_next()
+ local buffer = buffer
local current_line = buffer:line_from_position(buffer.current_pos)
local line = buffer:marker_next(current_line + 1, 1)
if line >= 0 then _m.textadept.editing.goto_line(line + 1) end
@@ -56,6 +59,7 @@ end
---
-- Goes to the previous bookmark in the current buffer.
function goto_prev()
+ local buffer = buffer
local current_line = buffer:line_from_position(buffer.current_pos)
local line = buffer:marker_previous(current_line - 1, 1)
if line >= 0 then _m.textadept.editing.goto_line(line + 1) end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 47166cf5..069135b2 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -1,5 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+local textadept = _G.textadept
+
---
-- Editing commands for the textadept module.
module('_m.textadept.editing', package.seeall)
@@ -232,7 +234,8 @@ end
-- Goes to the requested line.
-- @param line Optional line number to go to.
function goto_line(line)
- local buffer, locale = buffer, textadept.locale
+ 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 47819ae5..ee7a394b 100644
--- a/modules/textadept/lsnippets.lua
+++ b/modules/textadept/lsnippets.lua
@@ -1,5 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+local textadept = _G.textadept
+
---
-- Provides Lua-centric snippets for Textadept.
-- Snippets are basically pieces of text inserted into a document, but can
diff --git a/modules/textadept/macros.lua b/modules/textadept/macros.lua
index 978a3482..62f9f972 100644
--- a/modules/textadept/macros.lua
+++ b/modules/textadept/macros.lua
@@ -1,5 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+local textadept = _G.textadept
+
---
-- Support for recording, saving, and playing macros for the textadept module.
--
@@ -63,7 +65,7 @@ function stop_recording()
if not recording then return end
buffer:stop_record()
recording = false
- local textadept, locale = textadept, textadept.locale
+ local locale = textadept.locale
local ret, macro_name =
cocoa_dialog('standard-inputbox', {
['informative-text'] = locale.M_TEXTADEPT_MACRO_SAVE_TITLE,
@@ -117,7 +119,8 @@ function play(macro_name)
end
local macro = list[macro_name]
if not macro then return end
- local buffer, bf = buffer, textadept.buffer_functions
+ local buffer = buffer
+ local bf = textadept.buffer_functions
for _, command in ipairs(macro) do
local cmd, wParam, lParam = unpack(command)
local _, _, p1_type, p2_type = unpack(bf[cmd])
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index ec8cd11a..8d46610e 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -1,5 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+local textadept = _G.textadept
+
---
-- Provides Textmate-like snippets for the textadept module.
-- There are several option variables used: