Skip to content

Add LengthInBufferCells back to EditorServicesConsolePSHostRawUserInterface #1606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,53 @@ public override void SetBufferContents(
_internalRawUI.SetBufferContents(origin, contents);
}

/// <summary>
/// Determines the number of BufferCells a character occupies.
/// </summary>
/// <param name="source">
/// The character whose length we want to know.
/// </param>
/// <returns>
/// The length in buffer cells according to the original host
/// implementation for the process.
/// </returns>
public override int LengthInBufferCells(char source)
{
return _internalRawUI.LengthInBufferCells(source);
}
/// <summary>
/// Determines the number of BufferCells a string occupies.
/// </summary>
/// <param name="source">
/// The string whose length we want to know.
/// </param>
/// <returns>
/// The length in buffer cells according to the original host
/// implementation for the process.
/// </returns>
public override int LengthInBufferCells(string source)
{
return _internalRawUI.LengthInBufferCells(source);
}

/// <summary>
/// Determines the number of BufferCells a substring of a string occupies.
/// </summary>
/// <param name="source">
/// The string whose substring length we want to know.
/// </param>
/// <param name="offset">
/// Offset where the substring begins in <paramref name="source"/>
/// </param>
/// <returns>
/// The length in buffer cells according to the original host
/// implementation for the process.
/// </returns>
public override int LengthInBufferCells(string source, int offset)
{
return _internalRawUI.LengthInBufferCells(source, offset);
}

#endregion

/// <summary>
Expand Down