pwntester / octo.nvim

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

Improve goto_issue & on_cursor_hold #395

Closed delphinus closed 1 year ago

delphinus commented 1 year ago

Describe what this PR does / why we need it

I noticed both goto_issue and on_cursor_hold do not work with the latter issue when multi issues on one line.

# With such line below, `#12` can work, but no with `#13`.
See #12, #13

This PR solves this and slight bugs below.

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Run goto_issue and on_cursor_hold for each line and each issue/PR.

Short issue pattern: #393, #394, #395 Long issue pattern: pwntester/octo.nvim#393, pwntester/octo.nvim#394, pwntester/octo.nvim#395 URL issue pattern: https://github.com/pwntester/octo.nvim/pull/393, https://github.com/pwntester/octo.nvim/pull/394, https://github.com/pwntester/octo.nvim/pull/395

Special notes for reviews

delphinus commented 1 year ago

I noticed the logic cannot ignore the latter issue combining the former one, such as #123#234. I arrange such cases GitHub can detect in a table.

line can detect #234?
#123, #234 can
#123,#234 can
#123#234 cannot
#123_#234 cannot
#123 and#234 cannot

So it seems GitHub detects issues with a regex [^%w%d]+#(\d+). I fixed up the logic with such strategy: 01fa6e0.

pwntester commented 1 year ago

Thanks for the contributions!