Skip to content

Commit 72af0d0

Browse files
authored
Fix: Use file_name when old_file_name is not set (#495)
1 parent e9141cf commit 72af0d0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lua/gitlab/actions/draft_notes/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ M.build_root_draft_note = function(note)
155155
id = note.id,
156156
root_note_id = note.id,
157157
file_name = (type(note.position) == "table" and note.position.new_path or nil),
158+
old_file_name = (type(note.position) == "table" and note.position.old_path or nil),
158159
new_line = (type(note.position) == "table" and note.position.new_line or nil),
159160
old_line = (type(note.position) == "table" and note.position.old_line or nil),
160161
resolvable = false,

lua/gitlab/reviewer/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ end
110110
---@param line_number number Line number from the discussion node.
111111
---@param new_buffer boolean If true, jump to the NEW SHA.
112112
M.jump = function(file_name, old_file_name, line_number, new_buffer)
113+
-- Draft comments don't have `old_file_name` set
114+
old_file_name = old_file_name or file_name
115+
113116
if M.tabnr == nil then
114117
u.notify("Can't jump to Diffvew. Is it open?", vim.log.levels.ERROR)
115118
return

0 commit comments

Comments
 (0)