Skip to content

Commit

Permalink
Optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleBill committed Sep 5, 2014
1 parent 4715da6 commit a89e7d1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions autoload/colorizer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,17 @@ function! colorizer#ColorHighlight(update, ...) "{{{1
if g:colorizer_fgcontrast != s:saved_fgcontrast || (exists("a:1") && a:1 == '!')
let s:force_group_update = 1
endif
for i in range(line("w0"), line("w$"))

let cur_line = line("w0")
let end_line = line("w$")
while cur_line < end_line
" skip folded lines
if foldclosed(i) > 0
continue
if foldclosed(cur_line) > 0
let cur_line = foldclosedend(cur_line) + 1
endif
call s:PreviewColorInLine(i)
endfor
call s:PreviewColorInLine(cur_line)
let cur_line += 1
endwhile

" A hack for colorizing after opening a folding
if ( winheight('.') - line('w$') + line('w0') ) > 1
Expand Down

0 comments on commit a89e7d1

Please # to comment.