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

Commit cfdf410

Browse files
committed
Select just the target lines
Don't continue to column 0 on the line below.
1 parent 0fc10b7 commit cfdf410

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/GitHub.App/Services/GitHubContextService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ public bool TryOpenFile(GitHubContext context, string repositoryDir)
158158
{
159159
var lineEnd = context.LineEnd ?? line;
160160

161-
ErrorHandler.ThrowOnFailure(textView.SetSelection(line.Value - 1, 0, lineEnd.Value, 0));
161+
ErrorHandler.ThrowOnFailure(textView.GetBuffer(out IVsTextLines buffer));
162+
buffer.GetLengthOfLine(lineEnd.Value - 1, out int lineEndLength);
163+
164+
ErrorHandler.ThrowOnFailure(textView.SetSelection(line.Value - 1, 0, lineEnd.Value - 1, lineEndLength));
162165
ErrorHandler.ThrowOnFailure(textView.CenterLines(line.Value - 1, lineEnd.Value - line.Value + 1));
163166
}
164167

0 commit comments

Comments
 (0)