Skip to content

Commit 752aa45

Browse files
committed
Update diffview to latest master
Injecting winhl overrides is no longer needed, now that sindrets/diffview.nvim#70 is merged.
1 parent 13a5558 commit 752aa45

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

dotfiles/.config/nvim/lua/dotfiles/abbrev.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ function M.command(cmd, match)
1616
end
1717

1818
cabbrev('grep', 'silent grep!')
19+
cabbrev('Review', 'DiffviewOpen')
1920

2021
return M

dotfiles/.config/nvim/lua/dotfiles/commands.lua

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
local M = {}
22
local fn = vim.fn
3-
local dv = require('diffview')
4-
local dv_lib = require('diffview.lib')
5-
local diff = require('dotfiles.diff')
63

74
local function cmd(name, action, flags)
85
local flag_pairs = {}
@@ -41,16 +38,6 @@ function M.find_replace_register(find, replace)
4138
vim.cmd(cmd)
4239
end
4340

44-
function M.review(rev)
45-
dv.open(rev)
46-
47-
local view = dv_lib.get_current_diffview()
48-
49-
if view then
50-
diff.fix_highlight(view.left_winid, { force = true })
51-
end
52-
end
53-
5441
function M.terminal(cmd)
5542
vim.cmd(cmd)
5643
vim.cmd('term')
@@ -65,9 +52,6 @@ cmd(
6552
{ nargs = '+' }
6653
)
6754

68-
-- Git
69-
cmd('Review', 'lua dotfiles.commands.review(<f-args>)', { nargs = '?' })
70-
7155
-- Terminals
7256
cmd('Term', 'lua dotfiles.commands.terminal("new")')
7357
cmd('Vterm', 'lua dotfiles.commands.terminal("vnew")')

dotfiles/.config/nvim/lua/dotfiles/git.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local cb = require('diffview.config').diffview_callback
44

55
require('diffview').setup {
66
diff_binaries = false,
7+
enhanced_diff_hl = true,
78
file_panel = {
89
width = 40,
910
use_icons = true
@@ -22,6 +23,8 @@ require('diffview').setup {
2223
['U'] = cb('unstage_all'),
2324
['X'] = cb('restore_entry'),
2425
['R'] = cb('refresh_files'),
26+
[']f'] = cb('select_next_entry'),
27+
['[f'] = cb('select_prev_entry'),
2528
}
2629
}
2730
}

0 commit comments

Comments
 (0)