From 646453939941d92b077af56ce1d40793120bf97a Mon Sep 17 00:00:00 2001 From: jdhao Date: Mon, 18 Oct 2021 22:32:38 +0800 Subject: nvim-notify update --- core/autocommands.vim | 4 ++-- core/mappings.vim | 2 +- core/ui.vim | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/autocommands.vim b/core/autocommands.vim index 34a45a6..852f745 100644 --- a/core/autocommands.vim +++ b/core/autocommands.vim @@ -33,7 +33,7 @@ augroup END augroup non_utf8_file_warn autocmd! " we can not use `lua vim.notify()`: it will error out E5107 parsing lua. - autocmd BufRead * if &fileencoding != 'utf-8' | call v:lua.vim.notify('File not in UTF-8 format!', 'warn', {'title': 'nvim-config', 'timeout': 2500}) | endif + autocmd BufRead * if &fileencoding != 'utf-8' | call v:lua.vim.notify('File not in UTF-8 format!', 'warn', {'title': 'nvim-config'}) | endif augroup END " Automatically reload the file if it is changed outside of Nvim, see @@ -43,7 +43,7 @@ augroup END " https://vi.stackexchange.com/a/20397/15292. augroup auto_read autocmd! - autocmd FileChangedShellPost * call v:lua.vim.notify("File changed on disk. Buffer reloaded!", 'warn', {'title': 'nvim-config', 'timeout': 2500}) + autocmd FileChangedShellPost * call v:lua.vim.notify("File changed on disk. Buffer reloaded!", 'warn', {'title': 'nvim-config'}) autocmd FocusGained,CursorHold * if getcmdwintype() == '' | checktime | endif augroup END diff --git a/core/mappings.vim b/core/mappings.vim index d973ac0..82ba59a 100644 --- a/core/mappings.vim +++ b/core/mappings.vim @@ -104,7 +104,7 @@ inoremap pumvisible() ? "\" : "\" " Edit and reload init.vim quickly nnoremap ev :tabnew $MYVIMRC tcd %:h nnoremap sv :silent update $MYVIMRC source $MYVIMRC - \ call v:lua.vim.notify("Nvim config successfully reloaded!", 'info', {'title': 'nvim-config', 'timeout': 2500}) + \ call v:lua.vim.notify("Nvim config successfully reloaded!", 'info', {'title': 'nvim-config'}) " Reselect the text that has just been pasted, see also https://stackoverflow.com/a/4317090/6064933. nnoremap v printf('`[%s`]', getregtype()[0]) diff --git a/core/ui.vim b/core/ui.vim index 9af4743..415b927 100644 --- a/core/ui.vim +++ b/core/ui.vim @@ -91,10 +91,11 @@ let s:colorscheme_func = printf('s:my_theme_dict.%s()', s:theme) if has_key(s:my_theme_dict, s:theme) execute 'call ' . s:colorscheme_func - echomsg "Currently loaded theme:" s:theme + let s:msg1 = "Currently loaded theme: " . s:theme + call v:lua.vim.notify(s:msg1, 'info', {'title': 'nvim-config'}) else let s:msg = "Invalid colorscheme function: " . s:colorscheme_func - call v:lua.vim.notify(s:msg, 'error', {'title': 'nvim-config', 'timeout': 2500}) + call v:lua.vim.notify(s:msg, 'error', {'title': 'nvim-config'}) endif "}} "} -- cgit v1.2.3