feat(forge): add gx keymap to open forge links in browser (#165)

Problem: Forge shorthand tokens like `gh:user/repo#42` are concealed in
the buffer so Neovim's built-in `gx` cannot recognize them as URLs.
Full URLs are also concealed, making `gx` unreliable.

Solution: Add `open_link` action (default `gx`) that reads `forge_spans`
from line metadata. If the cursor is on a forge token, that link opens;
otherwise the last ref on the line is used. Delegates to `vim.ui.open()`.
This commit is contained in:
Barrett Ruth 2026-03-15 11:08:07 -04:00 committed by GitHub
parent f3ef1ca0db
commit 093e699413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 0 deletions

View file

@ -411,6 +411,10 @@ vim.keymap.set('n', '<Plug>(pending-edit-notes)', function()
require('pending').open_detail()
end)
vim.keymap.set('n', '<Plug>(pending-open-link)', function()
require('pending').open_link()
end)
vim.keymap.set('n', '<Plug>(pending-priority-up)', function()
require('pending').increment_priority()
end)