Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/diffview.txt
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,11 @@ COMMANDS *diffview-commands*
tabpage listing every linked git worktree.

Default keymaps on the overview buffer: >
q close the overview
R re-scan worktrees
<CR> open DiffView for the selected worktree
<
Close the overview with |:DiffviewClose| (same as
every other diffview tab).
Git only.

*:DiffviewLog*
Expand Down
1 change: 0 additions & 1 deletion doc/diffview_defaults.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ DEFAULT CONFIG *diffview.defaults*
{ "n", "<esc>", actions.close, { desc = "Close commit log" } },
},
worktree_overview = {
{ "n", "q", actions.close, { desc = "Close the worktree overview" } },
{ "n", "R", actions.refresh_files, { desc = "Re-scan worktrees and stats" } },
{ "n", "<CR>", actions.worktree_overview_enter, { desc = "Open DiffView for the selected worktree" } },
},
Expand Down
1 change: 0 additions & 1 deletion lua/diffview/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,6 @@ M.defaults = {
{ "n", "<esc>", actions.close, { desc = "Close commit log" } },
},
worktree_overview = {
{ "n", "q", actions.close, { desc = "Close the worktree overview" } },
{ "n", "R", actions.refresh_files, { desc = "Re-scan worktrees and stats" } },
{ "n", "<CR>", actions.worktree_overview_enter, { desc = "Open DiffView for the selected worktree" } },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,19 @@ describe("diffview.scene.views.worktree_overview WorktreeOverviewView", function
view = WorktreeOverviewView({ adapter = make_adapter(repo) })
view:open()

local lhs = { ["q"] = false, ["R"] = false, ["<CR>"] = false }
local lhs = { ["R"] = false, ["<CR>"] = false }
for _, m in ipairs(vim.api.nvim_buf_get_keymap(view.bufnr, "n")) do
-- `nvim_buf_get_keymap` may return `<CR>` normalised to the
-- literal "\r" in either `m.lhs` or `m.lhsraw` depending on the
-- Neovim version; compare every spelling so this test does not
-- depend on which form nvim is in the mood for.
if m.lhs == "q" or m.lhsraw == "q" then
lhs["q"] = true
end
if m.lhs == "R" or m.lhsraw == "R" then
lhs["R"] = true
end
if m.lhs == "<CR>" or m.lhs == "\r" or m.lhsraw == "\r" then
lhs["<CR>"] = true
end
end
assert.is_true(lhs["q"])
assert.is_true(lhs["R"])
assert.is_true(lhs["<CR>"])
end)
Expand Down
Loading