diff options
author | Marc Coquand <marc@baemingo.com> | 2023-05-22 18:45:33 -0500 |
---|---|---|
committer | Marc Coquand <marc@baemingo.com> | 2023-05-22 18:45:33 -0500 |
commit | 1873eab55fac197c50e58cc472b1c0170ff5f116 (patch) | |
tree | c4d9d9dca5f24a46b86df9f9119bf3c5481fbca8 /lua | |
parent | b9f81da9ae7133150fd56af8aeb7ec71d354c7c9 (diff) | |
download | BufferBrowser-1873eab55fac197c50e58cc472b1c0170ff5f116.tar.gz BufferBrowser-1873eab55fac197c50e58cc472b1c0170ff5f116.tar.bz2 BufferBrowser-1873eab55fac197c50e58cc472b1c0170ff5f116.zip |
Revert "Add check for filetype"
This reverts commit 1cdfa026cf1f6bbb877f9cd80a0bf563aaf1a21d.
Diffstat (limited to 'lua')
-rw-r--r-- | lua/buffer_browser.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lua/buffer_browser.lua b/lua/buffer_browser.lua index c9ab6d7..701e500 100644 --- a/lua/buffer_browser.lua +++ b/lua/buffer_browser.lua @@ -22,7 +22,7 @@ local function matchesFilter(filters, name) end -local function stateAppend(bufNr, stateFiletype, state, filters) +local function StateAppend(bufNr, stateFiletype, state, filters) if (state.current == bufNr) then return state end @@ -40,7 +40,7 @@ local function stateAppend(bufNr, stateFiletype, state, filters) end end -local function stateGoBack(state) +local function StateGoBack(state) -- Go back in the state by setting current to the first element of previous, and appending the current to the future -- Check if past is empty, if so return state as is if #state.previous == 0 then @@ -52,7 +52,7 @@ local function stateGoBack(state) return state end -local function stateGoForward(state) +local function StateGoForward(state) -- Go forward in the state by setting current to the first element of future, and appending the current to the previous -- Check if future is empty, if so return state as is @@ -136,8 +136,8 @@ local function getBufNr() end local function getFiletype(bufnr) - if (bufnr == nil and vim.bo[bufnr] == nil) then - return nil + if (bufnr == nil) then + return '' end return vim.bo[bufnr].filetype end @@ -153,7 +153,7 @@ function BufferBrowserBufferEnter(args) else if (state.current ~= bufNr) then local stateFiletype = getFiletype(state.current) - stateAppend(bufNr, stateFiletype, state, filters) + StateAppend(bufNr, stateFiletype, state, filters) setState(state) end end @@ -200,7 +200,7 @@ local function next() if stateIsEmpty(state) then initState(bufnr) else - stateGoForward(state) + StateGoForward(state) setState(state) end api.nvim_command('buffer ' .. state.current) @@ -213,7 +213,7 @@ local function prev() if stateIsEmpty(state) then initState(bufnr) else - stateGoBack(state) + StateGoBack(state) setState(state) end api.nvim_command('buffer ' .. state.current) |