Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bb542fe

Browse files
Add LengthInBufferCells back to EditorServicesConsolePSHostRawUserInterface (#1606)
These changes were accidentally forgotten in the rewrite and needed to be added back.
1 parent e073f4a commit bb542fe

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

‎src/PowerShellEditorServices/Services/PowerShell/Host/EditorServicesConsolePSHostRawUserInterface.cs‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,53 @@ public override void SetBufferContents(
263263
_internalRawUI.SetBufferContents(origin, contents);
264264
}
265265

266+
/// <summary>
267+
/// Determines the number of BufferCells a character occupies.
268+
/// </summary>
269+
/// <param name="source">
270+
/// The character whose length we want to know.
271+
/// </param>
272+
/// <returns>
273+
/// The length in buffer cells according to the original host
274+
/// implementation for the process.
275+
/// </returns>
276+
public override int LengthInBufferCells(char source)
277+
{
278+
return _internalRawUI.LengthInBufferCells(source);
279+
}
280+
/// <summary>
281+
/// Determines the number of BufferCells a string occupies.
282+
/// </summary>
283+
/// <param name="source">
284+
/// The string whose length we want to know.
285+
/// </param>
286+
/// <returns>
287+
/// The length in buffer cells according to the original host
288+
/// implementation for the process.
289+
/// </returns>
290+
public override int LengthInBufferCells(string source)
291+
{
292+
return _internalRawUI.LengthInBufferCells(source);
293+
}
294+
295+
/// <summary>
296+
/// Determines the number of BufferCells a substring of a string occupies.
297+
/// </summary>
298+
/// <param name="source">
299+
/// The string whose substring length we want to know.
300+
/// </param>
301+
/// <param name="offset">
302+
/// Offset where the substring begins in <paramref name="source"/>
303+
/// </param>
304+
/// <returns>
305+
/// The length in buffer cells according to the original host
306+
/// implementation for the process.
307+
/// </returns>
308+
public override int LengthInBufferCells(string source, int offset)
309+
{
310+
return _internalRawUI.LengthInBufferCells(source, offset);
311+
}
312+
266313
#endregion
267314

268315
/// <summary>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /