mirror of
https://github.com/junegunn/limelight.vim.git
synced 2025-11-08 11:03:48 -05:00
Merge pull request #18 from pgdouyon/master
Exclude whitespace-only lines from Limelight range
This commit is contained in:
@@ -43,19 +43,23 @@ function! s:unsupported()
|
||||
endfunction
|
||||
|
||||
function! s:getpos()
|
||||
let span = max([0, get(g:, 'limelight_paragraph_span', 0) - empty(getline('.'))])
|
||||
let span = max([0, get(g:, 'limelight_paragraph_span', 0) - s:empty(getline('.'))])
|
||||
let pos = getpos('.')
|
||||
for _ in range(0, span)
|
||||
let start = searchpos('^$', 'bW')[0]
|
||||
let start = searchpos('^\s*$', 'bW')[0]
|
||||
endfor
|
||||
call setpos('.', pos)
|
||||
for _ in range(0, span)
|
||||
let end = searchpos('^$', 'W')[0]
|
||||
let end = searchpos('^\s*$', 'W')[0]
|
||||
endfor
|
||||
call setpos('.', pos)
|
||||
return [start, end]
|
||||
endfunction
|
||||
|
||||
function! s:empty(line)
|
||||
return (a:line =~# '^\s*$')
|
||||
endfunction
|
||||
|
||||
function! s:limelight()
|
||||
if !empty(get(w:, 'limelight_range', []))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user