1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:20:04 +08:00

Fix lua bufsetlines api (#3639)

This commit is contained in:
Wang Shidong 2020-07-18 19:08:05 +08:00 committed by GitHub
parent 823d288b35
commit f11c31eac7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -116,8 +116,6 @@ function! s:self.redraw_windows() abort
return
endif
let self.notification_width = max(map(deepcopy(self.message), 'strwidth(v:val)'))
call self.__buffer.buf_set_lines(self.border.bufnr, 0 , -1, 0, self.draw_border(self.title, self.notification_width, len(self.message)))
call self.__buffer.buf_set_lines(self.bufnr, 0 , -1, 0, self.message)
let self.begin_row = 2
for hashkey in keys(s:notifications)
if hashkey !=# self.hashkey
@ -170,6 +168,8 @@ function! s:self.redraw_windows() abort
\ })
let self.win_is_open = v:true
endif
call self.__buffer.buf_set_lines(self.border.bufnr, 0 , -1, 0, self.draw_border(self.title, self.notification_width, len(self.message)))
call self.__buffer.buf_set_lines(self.bufnr, 0 , -1, 0, self.message)
endfunction

View File

@ -66,7 +66,7 @@ function! s:self.bufadd(name) abort
elseif has('lua') && empty(a:name)
let nr = float2nr(luaeval('vim.open().number'))
call setbufvar(nr, '&buflisted', 0)
return 0
return nr
elseif empty(a:name)
" create an no-named buffer
noautocmd 1new