Closed daliusd closed 8 months ago
I did some investigating and definitely should set virtual text to [DRAFT]
as seen here
https://github.com/pwntester/octo.nvim/blob/5a04268e54c3f538702ef4f03f635d69c569d23e/lua/octo/ui/writers.lua#L196-L202
Very weird that it's not. I've been irritated over not knowing if a pull request is a draft or not too.
Also, nvim_buf_set_virtual_text
is deprecated so it should probably be replaced with nvim_buf_set_extmark
Sorry for missing this issue. Should be fixed now
It still doesn't show in previews
I was able to fix the preview problem with the following change
--- a/lua/octo/pickers/telescope/previewers.lua
+++ b/lua/octo/pickers/telescope/previewers.lua
@@ -38,6 +38,14 @@ local issue = defaulter(function(opts)
elseif entry.kind == "pull_request" then
obj = result.data.repository.pullRequest
end
+
+ OctoBuffer:new {
+ bufnr = bufnr,
+ number = obj.number,
+ repo = entry.repo,
+ node = obj,
+ }
+
writers.write_title(bufnr, obj.title, 1)
writers.write_details(bufnr, obj)
writers.write_body(bufnr, obj)
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 in the issue previewer
Thanks @HampusMat Would you mind opening a PR please?
Sure
Issue Description
In PR view you don't see if PR is in Draft state.
Describe what happened (or what feature you want)
No way to identify if PR is Draft or not.
Describe what you expected to happen
I expect to see line indicating that PR is Draft (if it is).
How to reproduce it (as minimally and precisely as possible)
:Octo pr list
and select PR that is draft