]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vimcomplete): Try catch completion of `pack_jobs->add({`
authorMaxim Kim <habamax@gmail.com>
Wed, 27 Aug 2025 15:56:41 +0000 (17:56 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 27 Aug 2025 15:56:41 +0000 (17:56 +0200)
Fixes the issue, but not the root cause of #18137

related: #18137
closes: #18138

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/vimcomplete.vim

index 7536727a68b1252cdfcff6f7d8636fc2cb99268f..d75dfe634da53371b2e8ea394dfee053d3031d2d 100644 (file)
@@ -3,7 +3,7 @@ vim9script
 # Vim completion script
 # Language:    Vim script
 # Maintainer:  Maxim Kim <habamax@gmail.com>
-# Last Change: 2025-08-10
+# Last Change: 2025-08-27
 #
 # Usage:
 # setlocal omnifunc=vimcomplete#Complete
@@ -70,8 +70,11 @@ export def Complete(findstart: number, base: string): any
             ->mapnew((_, v) => ({word: v, kind: 'v', menu: 'Function', dup: 0}))
         items = commands + functions
     else
-        items = getcompletion(prefix, 'cmdline')
-            ->mapnew((_, v) => ({word: v->matchstr('\k\+'), kind: 'v', dup: 0}))
+        try
+            items = getcompletion(prefix, 'cmdline')
+                ->mapnew((_, v) => ({word: v->matchstr('\k\+'), kind: 'v', dup: 0}))
+        catch /E220/
+        endtry
 
         if empty(items) && !empty(base)
             items = getcompletion(base, 'expression')