Start of binary search for ls command

This commit is contained in:
2026-02-12 06:21:30 +01:00
parent f678c0fa54
commit 05c3dcd5b5
6 changed files with 106 additions and 15 deletions

View File

@@ -227,9 +227,24 @@ function result_ls(this: Bash, data: any, args: CommandArgs): HTMLElement {
return w;
}
return dummysonoerror; //TEMP SO NO ERROR CUZ RETURNS HTMLElement EVERY TIME, DELETE LATER
}
function checkMaxColumns(this: Bash, files: TreeNode[]) {
const paddingWidth: number = 2;
const maxWidth: number = (this.getTerminalWidth() / this.getTerminalFontSize()) * 0.8;
//Upper bound set to max width / min column width - 1 character + padding
let lowBound: number = 1;
let highBound: number = Math.floor(maxWidth / (1 + paddingWidth));
}
function isValidNodeSortMethod(value: string): value is SortNodeBy {
return Object.values(SortNodeBy).includes(value as SortNodeBy);
}