Merge branch 'master' into full
This commit is contained in:
@@ -92,7 +92,7 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
return;
|
||||
}
|
||||
this._ctx.lineWidth = 1;
|
||||
this._ctx.fillStyle = decoration.options.overviewRulerOptions.color;
|
||||
this._ctx.fillStyle = decoration.overviewRulerOptions?.color || decoration.options.overviewRulerOptions.color;
|
||||
this._ctx.fillRect(
|
||||
decoration.options.overviewRulerOptions.position === 'full' || decoration.options.overviewRulerOptions.position === 'left' ? 0 : decoration.options.overviewRulerOptions.position === 'right' ? renderSizes[SizeIndex.OUTER_SIZE] + renderSizes[SizeIndex.INNER_SIZE]: renderSizes[SizeIndex.OUTER_SIZE],
|
||||
Math.round(this._canvas.height * (decoration.options.marker.line / this._bufferService.buffers.active.lines.length)),
|
||||
@@ -120,7 +120,6 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
this._decorationElements.set(decoration, this._canvas);
|
||||
}
|
||||
this._refreshStyle(decoration, updateAnchor);
|
||||
decoration.onRenderEmitter.fire(this._canvas);
|
||||
}
|
||||
|
||||
private _queueRefresh(updateCanvasDimensions?: boolean, updateAnchor?: boolean): void {
|
||||
|
||||
+11
-1
@@ -98,6 +98,12 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
*/
|
||||
private _keyDownHandled: boolean = false;
|
||||
|
||||
/**
|
||||
* Records whether a keydown event has occured since the last keyup event, i.e. whether a key
|
||||
* is currently "pressed".
|
||||
*/
|
||||
private _keyDownSeen: boolean = false;
|
||||
|
||||
/**
|
||||
* Records whether the keypress event has already been handled and triggered a data event, if so
|
||||
* the input event should not trigger a data event but should still print to the textarea so
|
||||
@@ -1083,6 +1089,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
*/
|
||||
protected _keyDown(event: KeyboardEvent): boolean | undefined {
|
||||
this._keyDownHandled = false;
|
||||
this._keyDownSeen = true;
|
||||
|
||||
if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) {
|
||||
return false;
|
||||
@@ -1168,6 +1175,8 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
}
|
||||
|
||||
protected _keyUp(ev: KeyboardEvent): void {
|
||||
this._keyDownSeen = false;
|
||||
|
||||
if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {
|
||||
return;
|
||||
}
|
||||
@@ -1241,7 +1250,8 @@ export class Terminal extends CoreTerminal implements ITerminal {
|
||||
protected _inputEvent(ev: InputEvent): boolean {
|
||||
// Only support emoji IMEs when screen reader mode is disabled as the event must bubble up to
|
||||
// support reading out character input which can doubling up input characters
|
||||
if (ev.data && ev.inputType === 'insertText' && !ev.composed && !this.optionsService.rawOptions.screenReaderMode) {
|
||||
// Based on these event traces: https://github.com/xtermjs/xterm.js/issues/3679
|
||||
if (ev.data && ev.inputType === 'insertText' && (!ev.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) {
|
||||
if (this._keyPressHandled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user