public Task ExecuteAsync(AsyncData data, WorkSession session, ICommandResultSender sender, CancellationToken cancellationToken) { var @char = FastConvert.Utf8ByteArrayToChar(data.GetFirst()); session.ReplaceText(FastConvert.CharToString(@char), session.CursorPosition, 0); session.CursorPosition += 1; return(_effects.ApplyTypedCharAsync(@char, session, sender, cancellationToken)); }
public Task ApplyReplacedTextAsync(string reason, ITypedCharEffects typedCharEffects, WorkSession session, ICommandResultSender sender, CancellationToken cancellationToken) { if (reason != ChangeReasonCompletion) { return(Task.CompletedTask); } var pendingChar = session.CurrentCompletion.PendingChar; session.CurrentCompletion.ResetPending(); if (pendingChar == null) { return(Task.CompletedTask); } return(typedCharEffects.ApplyTypedCharAsync(pendingChar.Value, session, sender, cancellationToken)); }