From 0a4d82b17191a3213dfd397daa269e047d2d7cbb Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Wed, 6 Feb 2013 19:01:12 -0800 Subject: [PATCH] Don't leave whitespace on empty lines This was caused by complicated interactions with Vim. Fixes #15. --- autoload/youcompleteme.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index b13c2aac..200b8e96 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -297,12 +297,17 @@ function! s:InsideCommentOrString() endfunction +function! s:OnBlankLine() + return pyeval('not vim.current.line or vim.current.line.isspace()') +endfunction + + function! s:InvokeCompletion() if &completefunc != "youcompleteme#Complete" return endif - if s:InsideCommentOrString() + if s:InsideCommentOrString() || s:OnBlankLine() return endif