mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-08 04:27:47 +08:00
Ignore universal shortcuts inside inputs in cell output
This commit is contained in:
parent
e9d88ad7d7
commit
a4cc14ce26
1 changed files with 28 additions and 21 deletions
|
@ -301,28 +301,35 @@ const Session = {
|
||||||
const key = event.key;
|
const key = event.key;
|
||||||
const keyBuffer = this.keyBuffer;
|
const keyBuffer = this.keyBuffer;
|
||||||
|
|
||||||
// Universal shortcuts
|
// Universal shortcuts (ignore editable elements in cell output)
|
||||||
if (cmd && shift && !alt && key === "Enter") {
|
if (
|
||||||
cancelEvent(event);
|
!(
|
||||||
this.queueFullCellsEvaluation(true);
|
isEditableElement(event.target) &&
|
||||||
return;
|
event.target.closest(`[data-el-outputs-container]`)
|
||||||
} else if (!cmd && shift && !alt && key === "Enter") {
|
)
|
||||||
cancelEvent(event);
|
) {
|
||||||
if (isEvaluable(this.focusedCellType())) {
|
if (cmd && shift && !alt && key === "Enter") {
|
||||||
this.queueFocusedCellEvaluation();
|
cancelEvent(event);
|
||||||
|
this.queueFullCellsEvaluation(true);
|
||||||
|
return;
|
||||||
|
} else if (!cmd && shift && !alt && key === "Enter") {
|
||||||
|
cancelEvent(event);
|
||||||
|
if (isEvaluable(this.focusedCellType())) {
|
||||||
|
this.queueFocusedCellEvaluation();
|
||||||
|
}
|
||||||
|
this.moveFocus(1);
|
||||||
|
return;
|
||||||
|
} else if (cmd && !alt && key === "Enter") {
|
||||||
|
cancelEvent(event);
|
||||||
|
if (isEvaluable(this.focusedCellType())) {
|
||||||
|
this.queueFocusedCellEvaluation();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
} else if (cmd && key === "s") {
|
||||||
|
cancelEvent(event);
|
||||||
|
this.saveNotebook();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
this.moveFocus(1);
|
|
||||||
return;
|
|
||||||
} else if (cmd && !alt && key === "Enter") {
|
|
||||||
cancelEvent(event);
|
|
||||||
if (isEvaluable(this.focusedCellType())) {
|
|
||||||
this.queueFocusedCellEvaluation();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if (cmd && key === "s") {
|
|
||||||
cancelEvent(event);
|
|
||||||
this.saveNotebook();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.insertMode) {
|
if (this.insertMode) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue