From 2e8301161d5b0ef1e7a5762c090b3776da53dc60 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 28 Feb 2020 12:23:48 -0500 Subject: Allow view functions to be run from the command entry by name only. --- modules/textadept/command_entry.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/textadept/command_entry.lua') 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 -- cgit v1.2.3