mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-19 18:47:29 -07:00
Validate last buffer line of g:plug_window (#927)
Close #926 This fix shouldn't be necessary because vim-plug's buffer should always have 4 lines but a buffer can be modified in some cases before nvim 0.4.0 and vim v8.1.1360.
This commit is contained in:
parent
b2aa5724c0
commit
2f5f74e5e6
5
plug.vim
5
plug.vim
@ -1338,9 +1338,10 @@ function! s:bar()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:logpos(name)
|
function! s:logpos(name)
|
||||||
for i in range(4, line('$'))
|
let max = line('$')
|
||||||
|
for i in range(4, max > 4 ? max : 4)
|
||||||
if getline(i) =~# '^[-+x*] '.a:name.':'
|
if getline(i) =~# '^[-+x*] '.a:name.':'
|
||||||
for j in range(i + 1, line('$'))
|
for j in range(i + 1, max > 5 ? max : 5)
|
||||||
if getline(j) !~ '^ '
|
if getline(j) !~ '^ '
|
||||||
return [i, j - 1]
|
return [i, j - 1]
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user