ldelossa / gh.nvim

A fully featured GitHub integration for performing code reviews in Neovim.
MIT License
520 stars 24 forks source link

feat: sort filenames alphabetically in the files_changed tree #103

Closed GuillaumeLagrange closed 7 months ago

GuillaumeLagrange commented 7 months ago

Files come in a random order from the API

I propose we sort them before building the tree in order to have deterministic order on a PR, avoiding confusion.

This trick with the extra table is the simplest way I have found for a table in a sorted order by their index lua, let me know if I have missed a magical sort function.

ldelossa commented 7 months ago

Looks reasonable to me, curious tho, does this produce the same results as the Github Web UI?

GuillaumeLagrange commented 7 months ago

It does seem to be the case on the few PRs I have tested it on :ok_hand:

image image

ldelossa commented 7 months ago

awesome, thanks