Skip to content

Commit d39f0f7

Browse files
committed
Add LengthInBufferCells back to EditorServicesConsolePSHostRawUserInterface
These changes were accidentally forgotten in the rewrite and needed to be added back.
1 parent 7bf4299 commit d39f0f7

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

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

+47
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 this.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 this.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 this.internalRawUI.LengthInBufferCells(source, offset);
311+
}
312+
266313
#endregion
267314

268315
/// <summary>

0 commit comments

Comments
 (0)