Skip to content

Commit f9d1405

Browse files
committed
wip
1 parent 0f8158d commit f9d1405

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lua/codecompanion/diff/ui.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929

3030
---Show instructions for diff interaction
3131
---@param bufnr number
32-
---@param opts {namespace: number, line?: number, clear?: boolean}
32+
---@param opts {namespace: number, line?: number, overwrite?: boolean}
3333
---@return nil
3434
local function show_keymaps(bufnr, opts)
3535
local namespace = "codecompanion_diff_ui_" .. tostring(opts.namespace)
@@ -40,7 +40,7 @@ local function show_keymaps(bufnr, opts)
4040
local next_hunk = config.interactions.inline.keymaps.next_hunk.modes.n
4141
local previous_hunk = config.interactions.inline.keymaps.previous_hunk.modes.n
4242

43-
if opts.clear then
43+
if opts.overwrite then
4444
ui_utils.clear_notification(bufnr, { namespace = namespace })
4545
end
4646

@@ -65,14 +65,14 @@ function DiffUI:next_hunk(line)
6565
for _, hunk in ipairs(self.diff.hunks) do
6666
local hunk_line = hunk.pos[1] + 1
6767
if hunk_line > line then
68-
show_keymaps(self.bufnr, { clear = true, namespace = self.diff.namespace, line = hunk_line - 2 })
68+
show_keymaps(self.bufnr, { overwrite = true, namespace = self.diff.namespace, line = hunk_line - 2 })
6969
return ui_utils.scroll_to_line(self.bufnr, hunk_line)
7070
end
7171
end
7272

7373
if #self.diff.hunks > 0 then
7474
line = self.diff.hunks[1].pos[1] + 1
75-
show_keymaps(self.bufnr, { clear = true, namespace = self.diff.namespace, line = line - 2 })
75+
show_keymaps(self.bufnr, { overwrite = true, namespace = self.diff.namespace, line = line - 2 })
7676
ui_utils.scroll_to_line(self.bufnr, line)
7777
end
7878
end
@@ -85,14 +85,14 @@ function DiffUI:previous_hunk(line)
8585
local hunk = self.diff.hunks[i]
8686
local hunk_line = hunk.pos[1] + 1
8787
if hunk_line < line then
88-
show_keymaps(self.bufnr, { clear = true, namespace = self.diff.namespace, line = hunk_line - 2 })
88+
show_keymaps(self.bufnr, { overwrite = true, namespace = self.diff.namespace, line = hunk_line - 2 })
8989
return ui_utils.scroll_to_line(self.bufnr, hunk_line)
9090
end
9191
end
9292

9393
if #self.diff.hunks > 0 then
9494
line = self.diff.hunks[#self.diff.hunks].pos[1] + 1
95-
show_keymaps(self.bufnr, { clear = true, namespace = self.diff.namespace, line = line - 2 })
95+
show_keymaps(self.bufnr, { overwrite = true, namespace = self.diff.namespace, line = line - 2 })
9696
ui_utils.scroll_to_line(self.bufnr, line)
9797
end
9898
end

0 commit comments

Comments
 (0)