mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 12:38:39 -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() {
|
||||
// handle copying selected text
|
||||
if (this.props.copyOnSelect && this.term.hasSelection()) {
|
||||
onMouseUp(e) {
|
||||
if (this.props.quickEdit && e.button === 2) {
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue