mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
partially apply fast data access in InputHandler.print
This commit is contained in:
+1
-1
@@ -105,7 +105,7 @@ export class BufferLine implements IBufferLine {
|
||||
this._data[index * CELL_SIZE + Cell.FG],
|
||||
(content & Content.IS_COMBINED)
|
||||
? this._combined[index]
|
||||
: (cp) ? String.fromCharCode(cp) : '',
|
||||
: (cp) ? stringFromCodePoint(cp) : '',
|
||||
content >> Content.WIDTH_SHIFT,
|
||||
(content & Content.IS_COMBINED)
|
||||
? this._combined[index].charCodeAt(this._combined[index].length - 1)
|
||||
|
||||
+2
-2
@@ -435,14 +435,14 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
}
|
||||
|
||||
// write current char to buffer and advance cursor
|
||||
bufferRow.set(buffer.x++, [curAttr, stringFromCodePoint(code), chWidth, code]);
|
||||
bufferRow.setDataFromCodePoint(buffer.x++, code, chWidth, curAttr, 0);
|
||||
|
||||
// fullwidth char - also set next cell to placeholder stub and advance cursor
|
||||
// for graphemes bigger than fullwidth we can simply loop to zero
|
||||
// we already made sure above, that buffer.x + chWidth will not overflow right
|
||||
if (chWidth > 0) {
|
||||
while (--chWidth) {
|
||||
bufferRow.set(buffer.x++, [curAttr, '', 0, undefined]);
|
||||
bufferRow.setDataFromCodePoint(buffer.x++, 0, 0, curAttr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user