aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorMaria José Solano <majosolano99@gmail.com>2025-03-02 13:44:13 -0800
committerGitHub <noreply@github.com>2025-03-02 13:44:13 -0800
commit0a5a0efda64ccc789cda25b90fa907f277006cd3 (patch)
treecfd6082ae005ccb1debf68483be9de450796fcf1 /runtime/lua/vim
parent65c7033cbe75825c4cc948b71aba9a6d7a14540d (diff)
downloadrneovim-0a5a0efda64ccc789cda25b90fa907f277006cd3.tar.gz
rneovim-0a5a0efda64ccc789cda25b90fa907f277006cd3.tar.bz2
rneovim-0a5a0efda64ccc789cda25b90fa907f277006cd3.zip
feat(lua): don't complete private (_) fields after dot (.) #32690
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/_editor.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua
index 94168bea5d..975f3fea4a 100644
--- a/runtime/lua/vim/_editor.lua
+++ b/runtime/lua/vim/_editor.lua
@@ -913,6 +913,7 @@ function vim._expand_pat(pat, env)
local match_part = string.sub(last_part, search_index, #last_part)
local prefix_match_pat = string.sub(pat, 1, #pat - #match_part) or ''
+ local last_char = string.sub(last_part, #last_part)
local final_env = env
@@ -971,6 +972,7 @@ function vim._expand_pat(pat, env)
type(k) == 'string'
and string.sub(k, 1, string.len(match_part)) == match_part
and k:match('^[_%w]+$') ~= nil -- filter out invalid identifiers for field, e.g. 'foo#bar'
+ and (last_char ~= '.' or string.sub(k, 1, 1) ~= '_') -- don't include private fields after '.'
then
keys[k] = true
end