aboutsummaryrefslogtreecommitdiff
path: root/autoload/buf_utils.vim
diff options
context:
space:
mode:
authorMichal Hanus <hanus.michal@divelit.cz>2024-03-02 18:49:55 +0100
committerMichal Hanus <hanus.michal@divelit.cz>2024-03-02 18:49:55 +0100
commitaab38f32e0a02e43565a554d0a76ff65636499b8 (patch)
treef3f00df05c63228c69a338e80fd0e7d02986e8cf /autoload/buf_utils.vim
parent99353a355321d68ef4fb3c26291084b23e8f4978 (diff)
crazyshitHEADmaster
Diffstat (limited to 'autoload/buf_utils.vim')
-rw-r--r--autoload/buf_utils.vim30
1 files changed, 0 insertions, 30 deletions
diff --git a/autoload/buf_utils.vim b/autoload/buf_utils.vim
deleted file mode 100644
index 4af0ba6..0000000
--- a/autoload/buf_utils.vim
+++ /dev/null
@@ -1,30 +0,0 @@
-function! buf_utils#GoToBuffer(count, direction) abort
- if a:count == 0
- if a:direction ==# 'forward'
- bnext
- elseif a:direction ==# 'backward'
- bprevious
- else
- echoerr 'Bad argument ' a:direction
- endif
- return
- endif
- " Check the validity of buffer number.
- if index(s:GetBufNums(), a:count) == -1
- " 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, 4, {'title': 'nvim-config'})
- return
- endif
-
- " Do not use {count} for gB (it is less useful)
- if a:direction ==# 'forward'
- silent execute('buffer' . a:count)
- endif
-endfunction
-
-function! s:GetBufNums() abort
- return map(copy(getbufinfo({'buflisted':1})), 'v:val.bufnr')
-endfunction