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

feat(notify): support notify multiple lines

This commit is contained in:
wsdjeg 2022-10-27 22:27:56 +08:00
parent 4399354a8f
commit e9ecbbc530

View File

@ -164,9 +164,9 @@ endfunction
function! s:self.notify(msg, ...) abort
if self.notify_max_width ==# 0
let self.notify_max_width = &columns * 0.3
let self.notify_max_width = &columns * 0.35
endif
call add(self.message, a:msg)
call extend(self.message, split(a:msg, "\n"))
let self.notification_color = get(a:000, 0, 'Normal')
let options = get(a:000, 1, {})
let self.winblend = get(options, 'winblend', self.winblend)
@ -184,7 +184,7 @@ function! s:self.notify(msg, ...) abort
call setbufvar(self.border.bufnr, '&bufhidden', 'wipe')
call extend(s:notifications, {self.hashkey : self})
call self.increase_window()
call timer_start(self.timeout, self.close, {'repeat' : 1})
call timer_start(self.timeout, self.close, {'repeat' : len(split(a:msg, "\n"))})
endfunction
function! s:self.redraw_windows() abort