diff options
| author | jdhao <jdhao@hotmail.com> | 2022-08-26 19:47:56 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2022-08-26 19:47:56 +0800 |
| commit | bc9b0a8cf84fe5648d90412fe9c34a1b405f2e21 (patch) | |
| tree | 741253dc8ffa7953cf466b20b5de4e5f107b69fc | |
| parent | fb9a0bb2ddb689066e6ba1a827f2b1b27fe672ca (diff) | |
fix parameter for vim.notify
| -rw-r--r-- | autoload/buf_utils.vim | 2 | ||||
| -rw-r--r-- | core/mappings.vim | 2 | ||||
| -rw-r--r-- | lua/config/lsp.lua | 10 | ||||
| -rw-r--r-- | lua/plugins.lua | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/autoload/buf_utils.vim b/autoload/buf_utils.vim index 37e7a75..4af0ba6 100644 --- a/autoload/buf_utils.vim +++ b/autoload/buf_utils.vim @@ -15,7 +15,7 @@ function! buf_utils#GoToBuffer(count, direction) abort " we are essentially mixing Lua and vim script. We need to make sure that " args inside vim.notify() are valid vim values. The conversion from vim " value to lua value will be done by Nvim. See also https://github.com/neovim/neovim/pull/11338. - call v:lua.vim.notify('Invalid bufnr: ' . a:count, 'error', {'title': 'nvim-config'}) + call v:lua.vim.notify('Invalid bufnr: ' . a:count, 4, {'title': 'nvim-config'}) return endif diff --git a/core/mappings.vim b/core/mappings.vim index 11e13fa..23fe1ee 100644 --- a/core/mappings.vim +++ b/core/mappings.vim @@ -90,7 +90,7 @@ inoremap <expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>" " Edit and reload nvim config file quickly nnoremap <silent> <leader>ev :<C-U>tabnew $MYVIMRC <bar> tcd %:h<cr> nnoremap <silent> <leader>sv :<C-U>silent update $MYVIMRC <bar> source $MYVIMRC <bar> - \ call v:lua.vim.notify("Nvim config successfully reloaded!", 'info', {'title': 'nvim-config'})<cr> + \ call v:lua.vim.notify("Nvim config successfully reloaded!", 2, {'title': 'nvim-config'})<cr> " Reselect the text that has just been pasted, see also https://stackoverflow.com/a/4317090/6064933. nnoremap <expr> <leader>v printf('`[%s`]', getregtype()[0]) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 098303f..45b722b 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -71,7 +71,7 @@ local custom_attach = function(client, bufnr) if vim.g.logging_level == 'debug' then local msg = string.format("Language server %s started!", client.name) - vim.notify(msg, 'info', {title = 'Nvim-config'}) + vim.notify(msg, vim.log.levels.DEBUG, {title = 'Nvim-config'}) end end @@ -102,7 +102,7 @@ if utils.executable('pylsp') then capabilities = capabilities, }) else - vim.notify("pylsp not found!", 'warn', {title = 'Nvim-config'}) + vim.notify("pylsp not found!", vim.log.levels.WARN, {title = 'Nvim-config'}) end -- if utils.executable('pyright') then @@ -111,7 +111,7 @@ end -- capabilities = capabilities -- } -- else --- vim.notify("pyright not found!", 'warn', {title = 'Nvim-config'}) +-- vim.notify("pyright not found!", vim.log.levels.WARN, {title = 'Nvim-config'}) -- end if utils.executable('clangd') then @@ -124,7 +124,7 @@ if utils.executable('clangd') then }, }) else - vim.notify("clangd not found!", 'warn', {title = 'Nvim-config'}) + vim.notify("clangd not found!", vim.log.levels.WARN, {title = 'Nvim-config'}) end -- set up vim-language-server @@ -137,7 +137,7 @@ if utils.executable('vim-language-server') then capabilities = capabilities, }) else - vim.notify("vim-language-server not found!", 'warn', {title = 'Nvim-config'}) + vim.notify("vim-language-server not found!", vim.log.levels.WARN, {title = 'Nvim-config'}) end -- set up bash-language-server diff --git a/lua/plugins.lua b/lua/plugins.lua index c4cba2c..63e8d3c 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -381,6 +381,6 @@ if fresh_install then else local status, _ = pcall(require, 'packer_compiled') if not status then - vim.notify("Error requiring packer_compiled.lua: run PackerSync to fix!") + vim.notify("Error requiring packer_compiled.lua: run PackerSync to fix!", vim.log.levels.ERROR, { title = 'nvim-config' }) end end |
