From e9ecbbc530d24712b9d79c6bc9f558a4964145be Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Thu, 27 Oct 2022 22:27:56 +0800 Subject: [PATCH] feat(notify): support notify multiple lines --- autoload/SpaceVim/api/notify.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/api/notify.vim b/autoload/SpaceVim/api/notify.vim index 6598c3aa9..818114db2 100644 --- a/autoload/SpaceVim/api/notify.vim +++ b/autoload/SpaceVim/api/notify.vim @@ -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