aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-05-28 01:05:50 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-05-28 01:05:50 -0400
commit3a0af8b2f77401438e833923064ebe10df7230c7 (patch)
treee8b51bbc419b628463568235bcded404a35def55 /modules
parentb4406281a72c25aa2194bf05cb9d4efceb18785d (diff)
downloadtextadept-3a0af8b2f77401438e833923064ebe10df7230c7.tar.gz
textadept-3a0af8b2f77401438e833923064ebe10df7230c7.zip
Utilize list separator characters instead of hard-coded characters.
Diffstat (limited to 'modules')
-rw-r--r--modules/ansi_c/init.lua4
-rw-r--r--modules/lua/init.lua4
-rw-r--r--modules/textadept/editing.lua3
3 files changed, 8 insertions, 3 deletions
diff --git a/modules/ansi_c/init.lua b/modules/ansi_c/init.lua
index 957fefe0..3f6daf1d 100644
--- a/modules/ansi_c/init.lua
+++ b/modules/ansi_c/init.lua
@@ -47,6 +47,7 @@ textadept.editing.autocompleters.ansi_c = function()
end
-- Search through ctags for completions for that symbol.
local name_patt = '^'..part
+ local sep = string.char(buffer.auto_c_type_separator)
for i = 1, #M.tags do
if lfs.attributes(M.tags[i]) then
for line in io.lines(M.tags[i]) do
@@ -56,7 +57,8 @@ textadept.editing.autocompleters.ansi_c = function()
if (fields:match('class:(%S+)') or fields:match('enum:(%S+)') or
fields:match('struct:(%S+)') or fields:match('typedef:(%S+)') or
'') == symbol then
- list[#list + 1] = ("%s?%d"):format(name, xpms[fields:sub(1, 1)])
+ local k = xpms[fields:sub(1, 1)]
+ list[#list + 1] = ("%s%s%d"):format(name, sep, xpms[k])
list[name] = true
end
end
diff --git a/modules/lua/init.lua b/modules/lua/init.lua
index 82320b20..9c86b8bf 100644
--- a/modules/lua/init.lua
+++ b/modules/lua/init.lua
@@ -58,6 +58,7 @@ textadept.editing.autocompleters.lua = function()
end
-- Search through ctags for completions for that symbol.
local name_patt = '^'..part
+ local sep = string.char(buffer.auto_c_type_separator)
for i = 1, #M.tags do
if lfs.attributes(M.tags[i]) then
for line in io.lines(M.tags[i]) do
@@ -66,7 +67,8 @@ textadept.editing.autocompleters.lua = function()
local fields = line:match(';"\t(.*)$')
local k, class = fields:sub(1, 1), fields:match('class:(%S+)') or ''
if class == symbol and (op ~= ':' or k == 'f') then
- list[#list + 1], list[name] = ("%s?%d"):format(name, xpms[k]), true
+ list[#list + 1] = ("%s%s%d"):format(name, sep, xpms[k])
+ list[name] = true
end
end
end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 50ce21f3..dd008586 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -557,7 +557,8 @@ function M.autocomplete(name)
local len_entered, list = M.autocompleters[name]()
if not len_entered or not list or #list == 0 then return end
buffer.auto_c_order = buffer.ORDER_PERFORMSORT
- buffer:auto_c_show(len_entered, table.concat(list, ' '))
+ buffer:auto_c_show(len_entered,
+ table.concat(list, string.char(buffer.auto_c_separator)))
return true
end