aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/ansi_c
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-20 15:29:03 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2020-10-20 15:29:03 -0400
commit03c4016d07477781aa3adcc9edf340c0bec9c6c8 (patch)
treed3be089e9020807326a4e56562876ecb7bcf7892 /modules/ansi_c
parentb682fbd4a6e53185e2556686079532ad0e42be94 (diff)
Code cleanup.
Of note: * io.save_all_files() does not visit each buffer to save anymore. An unintended side-effect was checking for outside modification (but only if the file itself was modified), so outside changes will always be saved over now. * The menu clicked handler uses assert_type(), so the 'Unknown command' localization is no longer needed. * When printing to a new buffer type would split the view, use an existing split view when possible. * Prefer 'goto continue' construct in loops over nested 'if's. * Fixed clearing of ui.find.replace_entry_text on reset in the GUI version. * Fixed lack of statusbar updating when setting options like buffer EOL mode, indentation, and encoding. * Renamed internal new_snippet() to new() and put it in the snippet metatable.
Diffstat (limited to 'modules/ansi_c')
-rw-r--r--modules/ansi_c/init.lua13
1 files changed, 4 insertions, 9 deletions
diff --git a/modules/ansi_c/init.lua b/modules/ansi_c/init.lua
index 10a73ff6..3f5288c4 100644
--- a/modules/ansi_c/init.lua
+++ b/modules/ansi_c/init.lua
@@ -26,11 +26,7 @@ M.tags = {
M.autocomplete_snippets = true
local XPM = textadept.editing.XPM_IMAGES
-local xpms = setmetatable({
- c = XPM.CLASS, d = XPM.SLOT, e = XPM.VARIABLE, f = XPM.METHOD,
- g = XPM.TYPEDEF, m = XPM.VARIABLE, s = XPM.STRUCT, t = XPM.TYPEDEF,
- v = XPM.VARIABLE
-}, {__index = function() return 0 end})
+local xpms = setmetatable({c=XPM.CLASS,d=XPM.SLOT,e=XPM.VARIABLE,f=XPM.METHOD,g=XPM.TYPEDEF,m=XPM.VARIABLE,s=XPM.STRUCT,t=XPM.TYPEDEF,v=XPM.VARIABLE},{__index=function()return 0 end})
textadept.editing.autocompleters.ansi_c = function()
-- Retrieve the symbol behind the caret.
@@ -85,10 +81,9 @@ textadept.editing.autocompleters.ansi_c = function()
return #part, list
end
-local api_files = textadept.editing.api_files
-api_files.ansi_c[#api_files.ansi_c + 1] = _HOME .. '/modules/ansi_c/api'
-api_files.ansi_c[#api_files.ansi_c + 1] = _HOME .. '/modules/ansi_c/lua_api'
-api_files.ansi_c[#api_files.ansi_c + 1] = _USERHOME .. '/modules/ansi_c/api'
+for _, tags in ipairs(M.tags) do
+ table.insert(textadept.editing.api_files.ansi_c, (tags:gsub('tags$', 'api')))
+end
-- Commands.