mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
parent
215e03e0d5
commit
f4e32eee49
1 changed files with 15 additions and 1 deletions
|
|
@ -106,6 +106,20 @@ export default class Term extends PureComponent {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (props.onCursorMove) {
|
||||||
|
this.term.on('cursormove', () => {
|
||||||
|
const cursorFrame = {
|
||||||
|
x: this.term.buffer.x * this.term.renderer.dimensions.actualCellWidth,
|
||||||
|
y: this.term.buffer.y * this.term.renderer.dimensions.actualCellHeight,
|
||||||
|
width: this.term.renderer.dimensions.actualCellWidth,
|
||||||
|
height: this.term.renderer.dimensions.actualCellHeight,
|
||||||
|
col: this.term.buffer.y,
|
||||||
|
row: this.term.buffer.x
|
||||||
|
};
|
||||||
|
props.onCursorMove(cursorFrame);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
window.addEventListener('resize', this.onWindowResize, {
|
window.addEventListener('resize', this.onWindowResize, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
|
@ -271,7 +285,7 @@ export default class Term extends PureComponent {
|
||||||
// instead of invoking `destroy`, since it will make the
|
// instead of invoking `destroy`, since it will make the
|
||||||
// term insta un-attachable in the future (which we need
|
// term insta un-attachable in the future (which we need
|
||||||
// to do in case of splitting, see `componentDidMount`
|
// to do in case of splitting, see `componentDidMount`
|
||||||
['title', 'focus', 'data', 'resize'].forEach(type => this.term.removeAllListeners(type));
|
['title', 'focus', 'data', 'resize', 'cursormove'].forEach(type => this.term.removeAllListeners(type));
|
||||||
|
|
||||||
window.removeEventListener('resize', this.onWindowResize, {
|
window.removeEventListener('resize', this.onWindowResize, {
|
||||||
passive: true
|
passive: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue