diff options
author | Phạm Bình An <111893501+brianhuster@users.noreply.github.com> | 2025-03-26 06:35:12 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-26 07:35:12 +0800 |
commit | 6b00c9acfde954a3e992a2932eca9fa5902a1298 (patch) | |
tree | 508b05698449c06573e562088d5085ffccd65fce /runtime/lua/vim/_editor.lua | |
parent | a3b4743b4341d857ffc8a103f25ccb42ebc0e292 (diff) | |
download | rneovim-6b00c9acfde954a3e992a2932eca9fa5902a1298.tar.gz rneovim-6b00c9acfde954a3e992a2932eca9fa5902a1298.tar.bz2 rneovim-6b00c9acfde954a3e992a2932eca9fa5902a1298.zip |
fix(lua): no omni/cmdline completion for vim.env (#33044)
Problem:
- `:lua vim.env.<Tab>` does not show completion of environment variables
- Meanwhile, `:let $<Tab>` does show completion of environment variables
Solution:
- Fix it
Diffstat (limited to 'runtime/lua/vim/_editor.lua')
-rw-r--r-- | runtime/lua/vim/_editor.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index f0b8587476..e795c66969 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -1031,7 +1031,7 @@ function vim._expand_pat(pat, env) end -- Completion for dict accessors (special vim variables and vim.fn) - if mt and vim.tbl_contains({ vim.g, vim.t, vim.w, vim.b, vim.v, vim.fn }, final_env) then + if mt and vim.tbl_contains({ vim.g, vim.t, vim.w, vim.b, vim.v, vim.env, vim.fn }, final_env) then local prefix, type = unpack( vim.fn == final_env and { '', 'function' } or vim.g == final_env and { 'g:', 'var' } @@ -1039,6 +1039,7 @@ function vim._expand_pat(pat, env) or vim.w == final_env and { 'w:', 'var' } or vim.b == final_env and { 'b:', 'var' } or vim.v == final_env and { 'v:', 'var' } + or vim.env == final_env and { '', 'environment' } or { nil, nil } ) assert(prefix and type, "Can't resolve final_env") |