mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-14 15:19:12 +08:00
Fix todo manager
use vim#buffer api to edit buffer
This commit is contained in:
parent
6dec5feaaf
commit
efd28a3732
@ -6,12 +6,13 @@
|
||||
" License: GPLv3
|
||||
"=============================================================================
|
||||
|
||||
let s:JOB = SpaceVim#api#import('job')
|
||||
let s:BUFFER = SpaceVim#api#import('vim#buffer')
|
||||
|
||||
function! SpaceVim#dev#todo#list() abort
|
||||
call s:open_win()
|
||||
endfunction
|
||||
|
||||
let s:JOB = SpaceVim#api#import('job')
|
||||
|
||||
let s:bufnr = 0
|
||||
|
||||
function! s:open_win() abort
|
||||
@ -65,10 +66,8 @@ endfunction
|
||||
|
||||
function! s:exit(id, data, event ) abort
|
||||
call SpaceVim#logger#info('todomanager exit: ' . string(a:data))
|
||||
let g:lines = map(deepcopy(s:todos), "v:val.file . ' ' . v:val.title")
|
||||
call setbufvar(s:bufnr, '&modifiable', 1)
|
||||
call setline(1, g:lines)
|
||||
call setbufvar(s:bufnr, '&modifiable', 0)
|
||||
let lines = map(deepcopy(s:todos), "v:val.file . ' ' . v:val.title")
|
||||
call s:BUFFER.buf_set_lines(s:bufnr, 0 , -1, 0, lines)
|
||||
endfunction
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user