Deliver <CR> if no comment starter was found

Thanks to xckpd7 at #vim :)
This commit is contained in:
Øystein Walle 2012-11-26 17:39:08 +01:00
parent 392b0b1415
commit 3534df9cfd

View File

@ -53,7 +53,7 @@ function! s:Detect_empty_comment()
let s:commStart[&ft] = matchstr(&comments, s:pattern)
endif
let line = getline('.')
if line =~ '^\s*'. s:commStart[&ft] . '\s*$'
if s:commStart[&ft] && line =~ '^\s*'. s:commStart[&ft] . '\s*$'
return "\<C-U>"
else
return "\<CR>"