Skip to content

fix(tabs): correctly display oil.nvim buffers in tabline#1486

Open
tea06194 wants to merge 1 commit intonvim-lualine:masterfrom
tea06194:master
Open

fix(tabs): correctly display oil.nvim buffers in tabline#1486
tea06194 wants to merge 1 commit intonvim-lualine:masterfrom
tea06194:master

Conversation

@tea06194
Copy link
Copy Markdown

Fixes #1267

oil.nvim uses oil:// URIs as buffer names. fnamemodify() does not handle URI
schemes correctly and returns an empty string, causing tabs to show [No Name].

This patch detects oil buffers explicitly and strips the oil:// prefix before
formatting the path, keeping existing tabline behavior intact.

@abeaufays
Copy link
Copy Markdown

Hello ! I believe you have missed the oil extension?
See https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/extensions/oil.lua
You can use it like this:

    {
        'nvim-lualine/lualine.nvim',
        dependencies = { 'nvim-tree/nvim-web-devicons' },
        config = function()
            require('lualine').setup {
                extensions = { 'oil' },
            }
        end,
    },

@abeaufays
Copy link
Copy Markdown

In case you were not satisfied with the oil extension, I made a PR about it too: #1488

@tea06194
Copy link
Copy Markdown
Author

tea06194 commented Jan 7, 2026

@abeaufays

Hello ! I believe you have missed the oil extension? See https://github.com/nvim-lualine/lualine.nvim/blob/master/lua/lualine/extensions/oil.lua You can use it like this:

    {
        'nvim-lualine/lualine.nvim',
        dependencies = { 'nvim-tree/nvim-web-devicons' },
        config = function()
            require('lualine').setup {
                extensions = { 'oil' },
            }
        end,
    },

Thanks for the suggestion!

This change simply extends the existing special-case handling in
Tab:label() (fugitive/help/terminal) to cover oil buffers, which expose
URI-based buffer names that fnamemodify() cannot handle directly.
This logic is part of the tabline tabs component and does not overlap with
statusline extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: tab label is blank on oil

2 participants