aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/adeptsense.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-09-12 15:00:08 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-09-12 15:00:08 -0400
commitd0264d375273bb661aa030f1f2cbd83b46e30268 (patch)
treeb416bdc2e0bced6c69ab93e2f6248ff335925026 /modules/textadept/adeptsense.lua
parent8fe4dfdde7d2071040c1225f1112da154a84eacd (diff)
downloadtextadept-d0264d375273bb661aa030f1f2cbd83b46e30268.tar.gz
textadept-d0264d375273bb661aa030f1f2cbd83b46e30268.zip
Changed `events.disconnect()` to accept function argument instead of ID.
Diffstat (limited to 'modules/textadept/adeptsense.lua')
-rw-r--r--modules/textadept/adeptsense.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua
index 2898bc0c..84938f24 100644
--- a/modules/textadept/adeptsense.lua
+++ b/modules/textadept/adeptsense.lua
@@ -617,13 +617,13 @@ end
function M.add_trigger(sense, c, only_fields, only_functions)
if #c > 2 then return end -- TODO: warn
local c1, c2 = c:match('.$'):byte(), #c > 1 and c:sub(1, 1):byte()
- local i = events.connect(events.CHAR_ADDED, function(char)
+ sense.events[#sense.events + 1] = function(char)
if char == c1 and buffer:get_lexer(true) == sense.lexer then
if c2 and buffer.char_at[buffer.current_pos - 2] ~= c2 then return end
sense:complete(only_fields, only_functions)
end
- end)
- sense.events[#sense.events + 1] = i
+ end
+ events.connect(events.CHAR_ADDED, sense.events[#sense.events])
end
---
@@ -881,8 +881,8 @@ function M.new(lang)
if sense then
sense.ctags_kinds = nil
sense.api_files = nil
- for _, i in ipairs(sense.events) do
- events.disconnect(events.CHAR_ADDED, i)
+ for _, f in ipairs(sense.events) do
+ events.disconnect(events.CHAR_ADDED, f)
end
sense.events = nil
sense:clear()
@@ -894,8 +894,8 @@ function M.new(lang)
always_show_globals = true,
---
--- A map of Ctags kinds to Adeptsense kinds.
--- Recognized kinds are `FUNCTION`, `FIELD`, and `CLASS`. Classes are quite
+-- A map of Ctags kinds to Adeptsense types.
+-- Recognized types are `FUNCTION`, `FIELD`, and `CLASS`. Classes are quite
-- simply containers for functions and fields so Lua modules would count as
-- classes. Any other kinds will be passed to `handle_ctag()` for user-defined
-- handling.
@@ -950,7 +950,7 @@ api_files = {},
---
-- Map of language-specific syntax settings.
--- @field self The language's syntax-equivalent of `self`. The default value is
+-- @field self The language's syntax-equivalent of "self". The default value is
-- `'self'`.
-- @field class_definition A Lua pattern representing the language's class
-- definition syntax. The first capture returned must be the class name. A