Skip to content

Commit

Permalink
Support per-item CommitChars
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutch committed Jul 7, 2023
1 parent 8f04ce9 commit 25d442c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Editor/Completion/XmlCompletionCommitManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ public CommitResult TryCommit (IAsyncCompletionSession session, ITextBuffer buff
return CommitResult.Unhandled;
}

// per-item CommitCharacters overrides the default commit chars
if (!item.CommitCharacters.IsDefaultOrEmpty) {
if (item.CommitCharacters.Contains (typedChar)) {
return CommitCancel;
}
}

var span = session.ApplicableToSpan.GetSpan (buffer.CurrentSnapshot);
bool wasTypedInFull = span.Length == item.InsertText.Length;

Expand Down

0 comments on commit 25d442c

Please sign in to comment.