refactor(git): gitlog as gitlog:// URI singleton, fix synthetic-URI cwd resolve
This commit is contained in:
+8
-1
@@ -182,7 +182,11 @@ function M.read_uri(buf)
|
||||
vim.b[buf].git_worktree = worktree
|
||||
|
||||
vim.bo[buf].swapfile = false
|
||||
vim.bo[buf].bufhidden = "wipe"
|
||||
-- `unload` frees content when the buffer is hidden, but keeps the
|
||||
-- bufnr in the buffer list so the jumplist's `(bufnr, line, col)`
|
||||
-- entries stay valid. `<C-o>` back to a hidden URI buffer triggers
|
||||
-- the BufReadCmd again, refreshing content via `cat-file -p`.
|
||||
vim.bo[buf].bufhidden = "unload"
|
||||
|
||||
---@type string?
|
||||
local stdout = pending_content[buf]
|
||||
@@ -228,6 +232,9 @@ function M.read_uri(buf)
|
||||
end
|
||||
|
||||
if stdout then
|
||||
-- Reload paths (`:e`, `<C-o>` to an unloaded buf) re-enter
|
||||
-- with `modifiable = false` from the prior load.
|
||||
vim.bo[buf].modifiable = true
|
||||
vim.api.nvim_buf_set_lines(buf, 0, -1, false, util.split_lines(stdout))
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user