aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2011-06-28 17:00:42 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2011-06-28 17:00:42 -0400
commitc407317f84ae66afd5843b00237318f083a0eddd (patch)
treed592b6c7b1dd714057a258b930240c2584be7be5 /modules
parenta5790e42bb64bd6405f4fde010a3c17efd02d005 (diff)
downloadtextadept-c407317f84ae66afd5843b00237318f083a0eddd.tar.gz
textadept-c407317f84ae66afd5843b00237318f083a0eddd.zip
Small Adeptsense improvements.
Diffstat (limited to 'modules')
-rw-r--r--modules/lua/init.lua11
-rw-r--r--modules/textadept/adeptsense.lua4
2 files changed, 7 insertions, 8 deletions
diff --git a/modules/lua/init.lua b/modules/lua/init.lua
index 83527685..9e0979ef 100644
--- a/modules/lua/init.lua
+++ b/modules/lua/init.lua
@@ -70,12 +70,11 @@ sense.ctags_kinds = {
sense:load_ctags(_HOME..'/modules/lua/tags', true)
-- Strips '_G' from symbols since it's implied.
-function sense:get_class(symbol)
- if symbol:find('^_G') then
- symbol = symbol:gsub('_G%.?', '')
- if symbol == '' then return '' end
- end
- return self.super.get_class(self, symbol)
+function sense:get_symbol()
+ local symbol, part = self.super.get_symbol(self)
+ if symbol:find('^_G') then symbol = symbol:gsub('_G%.?', '') end
+ if part == '_G' then part = '' end
+ return symbol, part
end
-- Shows an autocompletion list for the symbol behind the caret.
diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua
index cadbebcb..f0db63ae 100644
--- a/modules/textadept/adeptsense.lua
+++ b/modules/textadept/adeptsense.lua
@@ -586,8 +586,8 @@ function show_apidoc(sense)
buffer:goto_pos(buffer:word_end_position(s, true))
local line, p = buffer:get_cur_line()
line = line:sub(1, p)
- symbol = line:match('('..sense.syntax.symbol_chars..'+)%s*%([^)]*$') or
- line:match('('..sense.syntax.symbol_chars..'+)%s*$') or ''
+ symbol = line:match('('..sense.syntax.symbol_chars..'+)%s*$') or
+ line:match('('..sense.syntax.symbol_chars..'+)%s*%([^()]*$') or ''
buffer:goto_pos(e)
else
symbol = buffer:text_range(s, e)