NTBBloodbath / galaxyline.nvim

neovim statusline plugin written in lua
MIT License
163 stars 16 forks source link

Downside of using gitsigns variables directly #4

Closed mks1508 closed 2 years ago

mks1508 commented 2 years ago

If git repo is just been initialized and have no commit, b:gitsigns_head will still exist but with value "" So should we use something like:

local function is_empty(something)
  return something == nil or something == ""
end

if is_empty(vim.b.gitsigns_head) then
  return
end

Instead of vim.fn.exists("b:gitsigns_head")

NTBBloodbath commented 2 years ago

Hi, thank you for pointing this (haven't tried with new repositories, only existing ones). I'll fix it asap :slightly_smiling_face: