Skip to content

Commit

Permalink
Ensure the caret is visible after commit
Browse files Browse the repository at this point in the history
Fixes #33822
  • Loading branch information
sharwell committed Mar 3, 2019
1 parent 2cab0d7 commit 1813a33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ private AsyncCompletionData.CommitBehavior Commit(
{
view.TryMoveCaretToAndEnsureVisible(new SnapshotPoint(subjectBuffer.CurrentSnapshot, mappedSpan.Start.Position + adjustedNewText.Length));
}
else
{
view.Caret.EnsureVisible();
}
}

includesCommitCharacter = change.IncludesCommitCharacter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ int P { get { $$} }
assertCaretPosition: true);
}

[ConditionalWpfFact(typeof(LegacyCompletionCondition)), Trait(Traits.Feature, Traits.Features.Completion)]
[WpfFact, Trait(Traits.Feature, Traits.Features.Completion)]
[WorkItem(33822, "https://github.com/dotnet/roslyn/issues/33822")]
public void EnsureTheCaretIsVisibleAfterALongEdit()
{
Expand Down

0 comments on commit 1813a33

Please sign in to comment.