tamton-aquib / staline.nvim

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

Color Line. exceeding indicator #16

Closed fedoranvar closed 2 years ago

fedoranvar commented 2 years ago

Good day to you!

I have "Color Line setup from WikiExamples: When i have one window open - it's okay

But when if i have any splits, then i have exceeding-indicator ("<"): image that's because vim.o.columns - is showing width of neovim instance, but not for current window

my question is: how to get rid of this sign?

tamton-aquib commented 2 years ago

Heyyo @fedoranvar , sorry for the late reply 😅

Actually i completely forgot about splits when tryin out color line, so i always used vim.o.columns. To get width of a single window, we could use vim.api.nvim_win_get_width or vim.fn.winwidth Example:

require("staline").setup {
    sections = {
        left = {
            function()
                return ("▁"):rep(vim.api.nvim_win_get_width(0))
            end
        }, -- change thickness: "_", "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"
        mid = {},
        right = {}
    },
}
fedoranvar commented 2 years ago

@tamton-aquib

yes, that helped!

Thank you!