quickEdit support (#2392)

This commit is contained in:
Derrick Pelletier 2017-11-03 15:01:21 -07:00 committed by CHaBou
parent d248069b78
commit 81c5829e1b

View file

@ -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());
}
}