nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.72k stars 455 forks source link

Bug: Not detecting branch on files in subdirectories #1183

Open Jlchong3 opened 5 months ago

Jlchong3 commented 5 months ago

The lualine detects the branch I am in when I use a file in the same directory as the .git, but when going to a file in a subdirectory lualine stops showing the branch I am in, is that supposed to happen?

Here it is with a file in the same directory as .git image

When entering a file in a subdirectory image

Leeto1970 commented 5 months ago

Use ":e path/to/your/file" or use telescope plugin to find file can solve this problem.

bwpge commented 5 months ago

Came across this today, To add a few more details:

My initial reaction is that this may be caused by how neo-tree opens files, since I don't get the same issue with telescope - but I don't have any evidence to back up that claim.

Edit: fixed wording

bwpge commented 5 months ago

I just stumbled across a Neo-tree issue that seems to be the cause of this issue. Linking to it here so both issues have visibility on each other: https://github.com/nvim-neo-tree/neo-tree.nvim/issues/1264

This looks like it would be a Windows-specific problem from Neo-tree, and @Jlchong3 from your path separator it seems you are on Windows as well. I also verified, I'm not getting this git branch problem on WSL with the exact same config when opening from Neo-tree.

bwpge commented 4 months ago

I believe this issue is fixed by the latest PR mentioned above in neo-tree.nvim. If you want to double check you can pull the plugin with lazy using:


{
    "nvim-neo-tree/neo-tree.nvim",
    branch = "main".
    -- ...
}