lucc / nvimpager

Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Other
365 stars 19 forks source link

Add git_colors option #68

Closed name-snrl closed 2 years ago

name-snrl commented 2 years ago

I use difftastic for git diff, I want to see colors from it. This PR adds option to use colors from the git commands instead nvim highlighting

lucc commented 2 years ago

Nice idea! Do you think you can add a simple test for this? Maybe you could copy this test and set your option and then check that the result is as you expect https://github.com/lucc/nvimpager/blob/fc18a96a0cb792ffa6c5adce4d398e685736d4c2/test/nvimpager_spec.lua#L734-L739

lucc commented 2 years ago

I just checked and the input file of this test does not have any ansi escape sequences.

How is the call order when you use an external diff command with git? git -> difft -> pager? Then we would need a file with the escape sequences from difft to test this nicely.

name-snrl commented 2 years ago

Sorry, don't know how tests work, can't help with that. But yes, the order is correct: git -> difft -> pager