mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-18 06:28:40 -09:00
quickEdit support (#2392)
This commit is contained in:
parent
d248069b78
commit
81c5829e1b
1 changed files with 9 additions and 3 deletions
|
|
@ -129,9 +129,15 @@ export default class Term extends PureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseUp() {
|
onMouseUp(e) {
|
||||||
// handle copying selected text
|
if (this.props.quickEdit && e.button === 2) {
|
||||||
if (this.props.copyOnSelect && this.term.hasSelection()) {
|
if (this.term.hasSelection()) {
|
||||||
|
clipboard.writeText(this.term.getSelection());
|
||||||
|
this.term.clearSelection();
|
||||||
|
} else {
|
||||||
|
document.execCommand('paste');
|
||||||
|
}
|
||||||
|
} else if (this.props.copyOnSelect && this.term.hasSelection()) {
|
||||||
clipboard.writeText(this.term.getSelection());
|
clipboard.writeText(this.term.getSelection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue