Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Fix LHS diff path display.
Browse files Browse the repository at this point in the history
Fixes #1383
  • Loading branch information
grokys committed Dec 13, 2017
1 parent d2f5350 commit aee42c5
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -123,12 +123,12 @@ async Task DoDiffFile(IPullRequestFileNode file, bool workingDirectory)
{
try
{
var relativePath = System.IO.Path.Combine(file.DirectoryPath, file.FileName);
var rightPath = System.IO.Path.Combine(file.DirectoryPath, file.FileName);
var leftPath = file.OldPath ?? rightPath;
var rightFile = workingDirectory ? ViewModel.GetLocalFilePath(file) : await ViewModel.ExtractFile(file, true);
var leftFile = await ViewModel.ExtractFile(file, false);
var fullPath = System.IO.Path.Combine(ViewModel.LocalRepository.LocalPath, relativePath);
var leftLabel = $"{relativePath};{ViewModel.TargetBranchDisplayName}";
var rightLabel = workingDirectory ? relativePath : $"{relativePath};PR {ViewModel.Model.Number}";
var leftLabel = $"{leftPath};{ViewModel.TargetBranchDisplayName}";
var rightLabel = workingDirectory ? rightPath : $"{rightPath};PR {ViewModel.Model.Number}";
var caption = $"Diff - {file.FileName}";
var options = __VSDIFFSERVICEOPTIONS.VSDIFFOPT_DetectBinaryFiles |
__VSDIFFSERVICEOPTIONS.VSDIFFOPT_LeftFileIsTemporary;
Expand Down Expand Up @@ -161,11 +161,11 @@ async Task DoDiffFile(IPullRequestFileNode file, bool workingDirectory)
var diffViewer = ((IVsDifferenceCodeWindow)docView).DifferenceViewer;

var session = ViewModel.Session;
AddBufferTag(diffViewer.LeftView.TextBuffer, session, relativePath, DiffSide.Left);
AddBufferTag(diffViewer.LeftView.TextBuffer, session, leftPath, DiffSide.Left);

if (!workingDirectory)
{
AddBufferTag(diffViewer.RightView.TextBuffer, session, relativePath, DiffSide.Right);
AddBufferTag(diffViewer.RightView.TextBuffer, session, rightPath, DiffSide.Right);
}

if (workingDirectory)
Expand Down

0 comments on commit aee42c5

Please sign in to comment.