pwntester / octo.nvim

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

fix: create OctoBuffers for issue previews #483

Closed HampusMat closed 5 months ago

HampusMat commented 5 months ago

Describe what this PR does / why we need it

The write_state function relies on there being a buffer in the octo_buffers table but there is none when called from the callback which is called after running Github CLI when defining a issue preview.

This causes that [DRAFT] isn't included in the issue preview title virtual text of draft pull requests.

Does this pull request fix one issue?

A part of fixing #453.

Describe how you did it

By making it so that before write_state is called, a OctoBuffer is created.

Describe how to verify it

Do :Octo pr list in a repository with draft pull requests and you'll see the preview(s) contain [DRAFT]

Special notes for reviews

HampusMat commented 5 months ago

Closing since #485 will make including [DRAFT] in previews unnecessary.