Skip to content

Commit aeca096

Browse files
committed
fix: Regression in buffer creation for renamed files.
1 parent a3fc4ae commit aeca096

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/diffview/scene/file_entry.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function FileEntry:convert_layout(target_layout)
110110
local function create_file(rev, symbol)
111111
return File({
112112
adapter = self.adapter,
113-
path = self.path,
113+
path = symbol == "a" and self.oldpath or self.path,
114114
kind = self.kind,
115115
commit = self.commit,
116116
get_data = get_data,
@@ -191,7 +191,7 @@ function FileEntry.with_layout(layout_class, opt)
191191
local function create_file(rev, symbol)
192192
return File({
193193
adapter = opt.adapter,
194-
path = opt.path,
194+
path = symbol == "a" and opt.oldpath or opt.path,
195195
kind = opt.kind,
196196
commit = opt.commit,
197197
get_data = opt.get_data,

0 commit comments

Comments
 (0)