feat: add formatting options for file_history_panel #441
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adding formatting option as a list of parts for the
file_history_panel
commit listThe default configuration includes all the parts that matches the commit format before this PR.
E.g.
Implementation
I defined a map of
formatters
, one per each part which allows the user to use a list as config. This looks up in the map and runs the formatter on theRenderComponent
table.The only significant change in the format is the part for
author, date
which now will show asauthor date
.Should we add a different HL to make a distinction?
Stylua prolems
I have ran the following command and it has reformatted a lot of files, I'm not sure why
stylua 0.19.1
Docs
I updated the only the default config docs. I'll need assistance to add an entry in the main docs since I don't have experience writing vim docs
Testing
I covered almost all cases except for
date
, in the branch that compares against the current time. This test would require to monkey patchos.time
which I don't think would be a good practice.Closes #438