mirror of
https://github.com/amix/vimrc
synced 2025-07-27 23:45:00 +08:00
Change Rainbow-parenthese plugin into Rainbow plugin.
This commit is contained in:
@ -39,6 +39,35 @@ function! coc#string#reflow(lines, width) abort
|
||||
return empty(lines) ? [''] : lines
|
||||
endfunction
|
||||
|
||||
function! coc#string#content_height(lines, width) abort
|
||||
let len = 0
|
||||
for line in a:lines
|
||||
if strwidth(line) <= a:width
|
||||
let len = len + 1
|
||||
else
|
||||
let currlen = 0
|
||||
for part in split(line, '\<\|\>\|\ze\s')
|
||||
let w = strwidth(part)
|
||||
if currlen + w >= a:width
|
||||
if currlen + w == a:width
|
||||
let len = len + 1
|
||||
let currlen = 0
|
||||
else
|
||||
let len = len + (a:width + w)/a:width
|
||||
let currlen = w%a:width
|
||||
endif
|
||||
else
|
||||
let currlen = currlen + w
|
||||
endif
|
||||
endfor
|
||||
if currlen > 0
|
||||
let len = len + 1
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return len == 0 ? 1 : len
|
||||
endfunction
|
||||
|
||||
" get change between two lines
|
||||
function! coc#string#diff(curr, previous, col) abort
|
||||
let end = strpart(a:curr, a:col - 1)
|
||||
|
Reference in New Issue
Block a user