Skip to content

Commit 5b058c7

Browse files
habamaxchrisbra
authored andcommitted
runtime(vimcomplete): do not complete on empty line
closes: #18561 Signed-off-by: Maxim Kim <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 6ab4547 commit 5b058c7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

runtime/autoload/vimcomplete.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Vim completion script
44
# Language: Vim script
55
# Maintainer: Maxim Kim <[email protected]>
6-
# Last Change: 2025-08-27
6+
# Last Change: 2025-10-13
77
#
88
# Usage:
99
# setlocal omnifunc=vimcomplete#Complete
@@ -36,6 +36,9 @@ enddef
3636
export def Complete(findstart: number, base: string): any
3737
if findstart > 0
3838
var line = getline('.')->strpart(0, col('.') - 1)
39+
if line =~ '\s\+$'
40+
return -2
41+
endif
3942
var keyword = line->matchstr('\k\+$')
4043
var stx = synstack(line('.'), col('.') - 1)->map('synIDattr(v:val, "name")')->join()
4144
if stx =~? 'Comment' || (stx =~ 'String' && stx !~ 'vimStringInterpolationExpr')

0 commit comments

Comments
 (0)