From 91407194760539859d5f3a88d142c4f893c111d3 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 9 Aug 2007 03:49:44 -0400 Subject: Improved completion of buffer functions and properties; core/handlers.lua Each buffer function or property is matched to prefix before being added to the completion list. --- core/handlers.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/handlers.lua b/core/handlers.lua index 5d7433d6..ec916fce 100644 --- a/core/handlers.lua +++ b/core/handlers.lua @@ -317,9 +317,13 @@ function show_completions(command) end if path == 'buffer' then if o == ':' then - for f in pairs(textadept.buffer_functions) do cmpls[#cmpls + 1] = f end + for f in pairs(textadept.buffer_functions) do + if f:match('^'..prefix) then cmpls[#cmpls + 1] = f end + end else - for p in pairs(textadept.buffer_properties) do cmpls[#cmpls + 1] = p end + for p in pairs(textadept.buffer_properties) do + if p:match('^'..prefix) then cmpls[#cmpls + 1] = p end + end end end table.sort(cmpls) -- cgit v1.2.3