mirror of
https://github.com/Green-Sky/crdt_tests.git
synced 2024-12-22 23:53:24 +01:00
fix crdt -> vim not deleting lines
This commit is contained in:
parent
4aa2a152af
commit
3725b76ce7
@ -221,10 +221,18 @@ function! GreenCRDTCheckTimeAndFetch()
|
|||||||
" dont update when inserting or visual (or atleast not in visual)
|
" dont update when inserting or visual (or atleast not in visual)
|
||||||
if mode() is# 'n'
|
if mode() is# 'n'
|
||||||
let l:response = ch_evalexpr(b:channel, [{'cmd': 'fetch_changes'}])
|
let l:response = ch_evalexpr(b:channel, [{'cmd': 'fetch_changes'}])
|
||||||
for [line_number, line] in l:response
|
" TODO: dont use empty as an indicator
|
||||||
call setline(line_number, line)
|
if ! empty(l:response)
|
||||||
endfor
|
for [line_number, line] in l:response
|
||||||
|
call setline(line_number, line)
|
||||||
|
endfor
|
||||||
|
|
||||||
|
let l:buffer_line_count = line('$')
|
||||||
|
let l:new_line_count = len(l:response)
|
||||||
|
if l:buffer_line_count > new_line_count
|
||||||
|
call deletebufline(bufnr(), l:new_line_count+1, buffer_line_count)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:green_crdt_fetch_timer = timer_start(503, 'GreenCRDTFetchTimerCallback')
|
let b:green_crdt_fetch_timer = timer_start(503, 'GreenCRDTFetchTimerCallback')
|
||||||
|
Loading…
Reference in New Issue
Block a user