aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
Diffstat (limited to 'autoload')
-rw-r--r--autoload/buf_utils.vim6
-rw-r--r--autoload/utils.vim22
2 files changed, 5 insertions, 23 deletions
diff --git a/autoload/buf_utils.vim b/autoload/buf_utils.vim
index fa2aefd..37e7a75 100644
--- a/autoload/buf_utils.vim
+++ b/autoload/buf_utils.vim
@@ -11,7 +11,11 @@ function! buf_utils#GoToBuffer(count, direction) abort
endif
" Check the validity of buffer number.
if index(s:GetBufNums(), a:count) == -1
- call utils#Log('Invalid bufnr: ' . a:count, 'error')
+ " Using `lua vim.notify('invalid bufnr: ' .. a:count)` won't work, because
+ " 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'})
return
endif
diff --git a/autoload/utils.vim b/autoload/utils.vim
index 217666b..9d84c9b 100644
--- a/autoload/utils.vim
+++ b/autoload/utils.vim
@@ -145,25 +145,3 @@ function! utils#Get_titlestr() abort
return l:title_str
endfunction
-
-" Log a message using certain highlight group
-function! utils#Log(msg, ...) abort
- let l:hi = ''
- if len(a:000) == 1
- if a:1 ==? 'info'
- let l:hi = 'Normal'
- elseif a:1 ==? 'warning'
- let l:hi = 'WarningMsg'
- elseif a:1 ==? 'error'
- let l:hi = 'ErrorMsg'
- else
- echoerr 'Unsupported log level:' a:1
- endif
- else
- let l:hi = 'Normal'
- endif
-
- execute 'echohl' l:hi
- unsilent echomsg a:msg
- echohl None
-endfunction