daliusd / ghlite.nvim

Neovim plugin to work GitHub PRs quickly.
MIT License
37 stars 1 forks source link

colorize pr output #4

Open justinmk opened 17 hours ago

justinmk commented 17 hours ago

Problem

Without any extra plugins (I'm assuming diffview.nvim might change the story here), selecting a PR with GHLitePRSelect shows a scratch buffer without any highlighting.

Proposal

https://github.com/neovim/neovim/issues/30415#issuecomment-2368519968 provides a code snippet that shows how nvim_open_term can be used to colorize terminal data from tools like gh. So if gh outputs colorized output, then that raw output can be passed to nvim_open_term to get colorized output in a Nvim buffer. This would also avoid ^M characters appearing in the buffer.

Note: this may require text=false here: https://github.com/daliusd/ghlite.nvim/blob/408dbc06cbc258569d74c9c37ac95a7a979a7e91/lua/ghlite/utils.lua#L5

daliusd commented 16 hours ago

That's really interesting and I will investigate this.