File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1159,7 +1159,18 @@ declare module '@xterm/xterm' {
11591159 deregisterCharacterJoiner ( joinerId : number ) : void ;
11601160
11611161 /**
1162- * Adds a marker to the normal buffer and returns it.
1162+ * Adds a marker to the normal buffer and returns it.
1163+ * NOTE: If you are synchronously writing data line-by-line (as in, doing
1164+ * multiple `term.writeln()`before the terminal re-rendering), the cursorY
1165+ * position will not be updated until after all pending terminal writes,
1166+ * which will result in the markers offset being calculated from the
1167+ * position cursorY was when your batch of writes started.
1168+ * Dealing with this issue by setting `cursorYOffset` to be index of this
1169+ * line in your batch will fail if you have any line wraps prior to it.
1170+ * Instead, consider registering a marker inside a write callback, eg.:
1171+ * ```ts
1172+ * term.writeln(data, () => term.registerMarker(...))
1173+ * ```
11631174 * @param cursorYOffset The y position offset of the marker from the cursor.
11641175 * @returns The new marker or undefined.
11651176 */
You can’t perform that action at this time.
0 commit comments