nvim-telescope / telescope-github.nvim

Integration with github cli
MIT License
221 stars 19 forks source link

update gh run list columns #23

Closed jacobfoard closed 3 years ago

jacobfoard commented 3 years ago

Fixes #22 and adds a note about the required gh version

windwp commented 3 years ago

sorry it is not working for me I get wrong id . I use gh 1.12.1 I think we don't need to get value from age or elapsed because we don't display it on table

jacobfoard commented 3 years ago

I dropped the new fields, I'm also on 1.12.1, so not sure what issue you're seeing.

diff --git a/lua/telescope/_extensions/gh_make_entry.lua b/lua/telescope/_extensions/gh_make_entry.lua
index be67b87..aba1adb 100644
--- a/lua/telescope/_extensions/gh_make_entry.lua
+++ b/lua/telescope/_extensions/gh_make_entry.lua
@@ -50,6 +50,7 @@ function gh_make_entry.gen_from_run(opts)
   return function (entry)
     if entry == '' then return nil end
     local tmp_table = vim.split(entry,"\t");
+    print(vim.inspect(tmp_table))
     local active = tmp_table[1] or ""
     local status = tmp_table[2] or ""
     local description = tmp_table[3] or ""

If you try that patch, which index are you seeing the id field in?

sbulav commented 3 years ago

I am using gh version 1.12.1 (2021-07-01), and for me local id = tmp_table[7] or "" is working fine. BTW, we can do something like this to support both versions:

    local id = ""
    if #tmp_table > 8 then 
        id = tmp_table[7]
    else
        id = tmp_table[#tmp_table]
    end
jacobfoard commented 3 years ago

An elegant solution @sbulav, much better than what I was thinking for parsing version numbers. I've pushed that fix.