Commit: runtime(vimcomplete): do not complete on empty line

0 views
Skip to first unread message

Christian Brabandt

unread,
3:00 PM (8 hours ago) 3:00 PM
to vim...@googlegroups.com
runtime(vimcomplete): do not complete on empty line

Commit: https://github.com/vim/vim/commit/5b058c76b445c21591662fd4f5c066ac42dbd61a
Author: Maxim Kim <hab...@gmail.com>
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 <hab...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

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 <hab...@gmail.com>
-# 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')
Reply all
Reply to author
Forward
0 new messages