Skip to content

Commit

Permalink
Improve docs of BufferLine.translateToString
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Nov 3, 2023
1 parent 5630239 commit b16724f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/common/buffer/BufferLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,17 @@ export class BufferLine implements IBufferLine {
}

/**
* If outColumns is specified, it will be filled with column numbers such that
* returnedString[i] is display at outColumns[i] column.
* outColumns[returnedString.length] is where the character following
* returnedString will be displayed.
* Translates the buffer line to a string.
*
* When a single cell is translated to multiple UTF-16 code units (e.g.
* surrogate pair) in the returned string, the corresponding entries in
* outColumns will have the same column number.
* @param trimRight Whether to trim any empty cells on the right.
* @param startCol The column to start the string (0-based inclusive).
* @param endCol The column to end the string (0-based exclusive).
* @param outColumns if specified, this array will be filled with column numbers such that
* `returnedString[i]` is displayed at `outColumns[i]` column. `outColumns[returnedString.length]`
* is where the character following `returnedString` will be displayed.
*
* When a single cell is translated to multiple UTF-16 code units (e.g. surrogate pair) in the
* returned string, the corresponding entries in `outColumns` will have the same column number.
*/
public translateToString(trimRight?: boolean, startCol?: number, endCol?: number, outColumns?: number[]): string {
startCol = startCol ?? 0;
Expand Down

0 comments on commit b16724f

Please sign in to comment.