runtime(vimcomplete): do not complete on empty line

Commit: 
https://github.com/vim/vim/commit/5b058c76b445c21591662fd4f5c066ac42dbd61a
Author: Maxim Kim <[email protected]>
Date:   Mon Oct 13 18:58:17 2025 +0000

    runtime(vimcomplete): do not complete on empty line
    
    closes: https://github.com/vim/vim/issues/18561
    
    Signed-off-by: Maxim Kim <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/vimcomplete.vim b/runtime/autoload/vimcomplete.vim
index d75dfe634..0de3bf2db 100644
--- a/runtime/autoload/vimcomplete.vim
+++ b/runtime/autoload/vimcomplete.vim
@@ -3,7 +3,7 @@ vim9script
 # Vim completion script
 # Language:    Vim script
 # Maintainer:  Maxim Kim <[email protected]>
-# Last Change: 2025-08-27
+# Last Change: 2025-10-13
 #
 # Usage:
 # setlocal omnifunc=vimcomplete#Complete
@@ -36,6 +36,9 @@ enddef
 export def Complete(findstart: number, base: string): any
     if findstart > 0
         var line = getline('.')->strpart(0, col('.') - 1)
+        if line =~ '\s\+$'
+            return -2
+        endif
         var keyword = line->matchstr('\k\+$')
         var stx = synstack(line('.'), col('.') - 1)->map('synIDattr(v:val, 
"name")')->join()
         if stx =~? 'Comment' || (stx =~ 'String' && stx !~ 
'vimStringInterpolationExpr')

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1v8NmB-00CiMz-GE%40256bit.org.

Raspunde prin e-mail lui