mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
remove unused code (#4117)
This commit is contained in:
parent
5bb03972d7
commit
f40496f127
2 changed files with 0 additions and 56 deletions
|
|
@ -1,3 +0,0 @@
|
||||||
export default function last<T>(arr: T[]): T {
|
|
||||||
return arr[arr.length - 1];
|
|
||||||
}
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
// Clear selection range of current selected term view
|
|
||||||
// Fix event when terminal text is selected and keyboard action is invoked
|
|
||||||
export const clear = terminal => {
|
|
||||||
terminal.document_.getSelection().removeAllRanges();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Use selection extend upon dblclick
|
|
||||||
export const extend = terminal => {
|
|
||||||
const sel = terminal.document_.getSelection();
|
|
||||||
|
|
||||||
// Test if focusNode exist and nodeName is #text
|
|
||||||
if (sel.focusNode && sel.focusNode.nodeName === '#text') {
|
|
||||||
terminal.screen_.expandSelection(sel);
|
|
||||||
if (terminal.copyOnSelect) {
|
|
||||||
terminal.copyStringToClipboard(sel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Fix a bug in ScrollPort selectAll behavior
|
|
||||||
// Select all rows in the viewport
|
|
||||||
export const all = terminal => {
|
|
||||||
const scrollPort = terminal.scrollPort_;
|
|
||||||
let firstRow;
|
|
||||||
let lastRow;
|
|
||||||
|
|
||||||
if (scrollPort.topFold_.nextSibling.rowIndex === 0) {
|
|
||||||
firstRow = scrollPort.topFold_.nextSibling;
|
|
||||||
} else {
|
|
||||||
while (scrollPort.topFold_.previousSibling) {
|
|
||||||
scrollPort.rowNodes_.removeChild(scrollPort.topFold_.previousSibling);
|
|
||||||
}
|
|
||||||
|
|
||||||
firstRow = scrollPort.fetchRowNode_(0);
|
|
||||||
scrollPort.rowNodes_.insertBefore(firstRow, scrollPort.topFold_);
|
|
||||||
scrollPort.syncRowNodesDimensions_();
|
|
||||||
}
|
|
||||||
|
|
||||||
const lastRowIndex = scrollPort.rowProvider_.getRowCount() - 1;
|
|
||||||
|
|
||||||
if (scrollPort.bottomFold_.previousSibling.rowIndex === lastRowIndex) {
|
|
||||||
lastRow = scrollPort.bottomFold_.previousSibling.rowIndex;
|
|
||||||
} else {
|
|
||||||
while (scrollPort.bottomFold_.nextSibling) {
|
|
||||||
scrollPort.rowNodes_.removeChild(scrollPort.bottomFold_.nextSibling);
|
|
||||||
}
|
|
||||||
|
|
||||||
lastRow = scrollPort.fetchRowNode_(lastRowIndex);
|
|
||||||
scrollPort.rowNodes_.appendChild(lastRow);
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollPort.selection.sync();
|
|
||||||
};
|
|
||||||
Loading…
Reference in a new issue