tamton-aquib / staline.nvim

A modern lightweight statusline and bufferline plugin for neovim in lua.
MIT License
380 stars 17 forks source link

sidebar offset for neo-tree in stabline #50

Closed abhilash26 closed 1 year ago

abhilash26 commented 1 year ago

Hello is there a way to achieve sidebar offset for neo-tree or nvim-tree like that in bufferline https://github.com/akinsho/bufferline.nvim#sidebar-offsets ?

tamton-aquib commented 1 year ago

Heyyo @abhilash26 , there isnt a direct way builtin in stabline (It was meant to be really minimal 😅 )

But there are stab_start and stab_end options as mentioned in the readme. I just pushed some changes that will allow them to take functions so we could do something like this for now:

require("stabline").setup {
    stab_start = function()
        if #vim.tbl_filter(function(b) return vim.bo[b].ft == "NvimTree" end, vim.api.nvim_list_bufs()) > 0 then
            return (" "):rep(require("nvim-tree").config.view.width)
        end
    end
}
abhilash26 commented 1 year ago

@tamton-aquib , I am very grateful for the speedy response and delivery.

For anyone using neo-tree use below code

        stab_start = function()
          if #vim.tbl_filter(function(b) return vim.bo[b].ft == "neo-tree" end, vim.api.nvim_list_bufs()) > 0 then
            return (" "):rep(require("neo-tree").config.window.width)
          end
        end
abhilash26 commented 1 year ago

Issue resolved. Lets close this.