aboutsummaryrefslogtreecommitdiff
path: root/modules/lua/init.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-02-19 22:09:25 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2020-02-19 22:09:25 -0500
commit33d616b5f2625a6a14a29c5ef780e0a528ebdd86 (patch)
treea8b3467c5082cebb0dc7c1e6821aa1e631941400 /modules/lua/init.lua
parent2a9d3e73daa332ffe652c9b33c160b784e51ed0e (diff)
downloadtextadept-33d616b5f2625a6a14a29c5ef780e0a528ebdd86.tar.gz
textadept-33d616b5f2625a6a14a29c5ef780e0a528ebdd86.zip
Allow Textadept API completions in special Lua buffers like a Lua REPL.
Diffstat (limited to 'modules/lua/init.lua')
-rw-r--r--modules/lua/init.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/lua/init.lua b/modules/lua/init.lua
index c199e4e8..4c6060f0 100644
--- a/modules/lua/init.lua
+++ b/modules/lua/init.lua
@@ -13,9 +13,9 @@ module('_M.lua')]]
-- Autocompletion and documentation.
--- Returns a function that, when called from a Textadept Lua file or the Lua
--- command entry, returns the given Textadept tags or API file for use in
--- autocompletion and documentation.
+-- Returns a function that, when called from a Textadept Lua file, the Lua
+-- command entry, or a special Lua buffer (e.g. a REPL), returns the given
+-- Textadept tags or API file for use in autocompletion and documentation.
-- @param filename Textadept tags or api file to return.
local function ta_api(filename)
local home = '^'.._HOME:gsub('%p', '%%%0'):gsub('%%[/\\]', '[/\\]')
@@ -23,7 +23,7 @@ local function ta_api(filename)
return function()
local buffer_filename = buffer.filename or ''
if buffer_filename:find(home) or buffer_filename:find(userhome) or
- buffer == ui.command_entry then
+ buffer == ui.command_entry or buffer._type then
return filename
end
end