diff options
author | 2020-02-28 12:23:48 -0500 | |
---|---|---|
committer | 2020-02-28 12:23:48 -0500 | |
commit | 2e8301161d5b0ef1e7a5762c090b3776da53dc60 (patch) | |
tree | 77f1cd572741419f1bf867863e503645909569ef /modules | |
parent | f26af5cde434cb4825d254d2d507de898ec77d77 (diff) | |
download | textadept-2e8301161d5b0ef1e7a5762c090b3776da53dc60.tar.gz textadept-2e8301161d5b0ef1e7a5762c090b3776da53dc60.zip |
Allow view functions to be run from the command entry by name only.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/command_entry.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index 1a5a3df9..b652e9d9 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -47,6 +47,8 @@ local env = setmetatable({}, { local f = buffer[k] if f and type(f) == 'function' then f = function(...) return buffer[k](buffer, ...) end + elseif f == nil and type(view[k]) == 'function' then + f = function(...) view[k](view, ...) end -- do not return a value elseif f == nil then f = view[k] or ui[k] or _G[k] end |