NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
3.83k stars 228 forks source link

Status buffer fixes #1244

Closed AThePeanut4 closed 5 months ago

AThePeanut4 commented 5 months ago

This fixes the issues with <Tab> in blank spaces. The problem is that the EmptyLine component was actually an instance of a component, and that instance was being shared between all the sections in the status buffer. That means that when the component tree is rendered, that single instance gets added to RendererIndex.index multiple times, and its position.row_start field gets overwritten multiple times. This results in the RendererIndex:find_by_line(line) method returning a component with a position.row_start that is not equal to the line argument, and that breaks everything.

I've also fixed an error that pops up if the upstream or pushRemote branches don't have any commits, and made the Head line show (detached) again when detached. When detached, the commit hash will always be shown, irrespective of show_head_commit_hash. If show_head_commit_hash is enabled, and the branch doesn't have any commits, then it displays "0000000".

Ref: #1233

CKolkey commented 5 months ago

Ahhhhhh, right 🤦🏼 . Much appreciated.