pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.33k stars 125 forks source link

fix: fix repo view #277

Closed ldelossa closed 2 years ago

ldelossa commented 2 years ago

previous to this commit viewing a repo on my day job's repo produced the following error:

Error executing vim.schedule lua callback: ...e/louis/.config/nvim/after/oc to.nvim/lua/octo/colors.lua:188: attempt to index local 'rgb_hex' (a userda ta value) stack traceback: ...e/louis/.config/nvim/after/octo.nvim/lua/octo/colors.lua:188: in function 'create_highlight' ...uis/.config/nvim/after/octo.nvim/lua/octo/ui/bubbles.lua:57: in function 'make_label_bubble' .../louis/.config/nvim/after/octo.nvim/lua/octo/writers.lua:66: in function 'add_details_line' .../louis/.config/nvim/after/octo.nvim/lua/octo/writers.lua:141: in function 'write_repo' ...nfig/nvim/after/octo.nvim/lua/octo/model/octo-buffer.lua:96: in function 'render_repo' /home/louis/.config/nvim/after/octo.nvim/lua/octo/init.lua:233: in function 'create_buffer' /home/louis/.config/nvim/after/octo.nvim/lua/octo/init.lua:64: in f unction 'cb' /home/louis/.config/nvim/after/octo.nvim/lua/octo/init.lua:93: in f unction 'cb' /home/louis/.config/nvim/after/octo.nvim/lua/octo/gh.lua:83: in fun ction '' vim/_editor.lua: in function <vim/_editor.lua:0>

This commit adds a default highlight group when creating a bubble, so that providing a nil hex value to the bubble constructor does not break.

Signed-off-by: ldelossa louis.delos@gmail.com

Describe what this PR does / why we need it

Fixes an issue where nil hex strings cause repo view commands to fail

Does this pull request fix one issue?

Describe how you did it

Provide a default "highlight group" when nil hex values are encountered

Describe how to verify it

you can try to open the cilum/cilium repo with current master to see issue and use this commit to see fix

Special notes for reviews

pwntester commented 2 years ago

Thanks!