Add lowercase
This commit is contained in:
13
repl.ts
13
repl.ts
@ -2,6 +2,7 @@ import faux from "./builtins.ts";
|
||||
import { getKeysPressed, shiftKeyDown, shiftMap, K } from "./keyboard.ts";
|
||||
import { font } from "./font.ts";
|
||||
import { runCode } from "./runcode.ts";
|
||||
import { clearScreen } from "./window.ts";
|
||||
|
||||
const lineHeight = 6;
|
||||
|
||||
@ -75,7 +76,7 @@ const update = () => {
|
||||
textLinesAbove.push(...resultString.split("\n"))
|
||||
}
|
||||
} catch (err) {
|
||||
textLinesAbove.push(...(err.name+":\n"+err.message).toLowerCase().split("\n"))
|
||||
textLinesAbove.push(...(err.name+":\n"+err.message).split("\n"))
|
||||
}
|
||||
textLinesAbove = textLinesAbove.slice(-20);
|
||||
maxLineLen = 0;
|
||||
@ -88,17 +89,19 @@ const update = () => {
|
||||
|
||||
const drawTextAbove = () => {
|
||||
textLinesAbove.forEach((line, i) => {
|
||||
faux.draw_rect(0, i*lineHeight, 4*(line.length+1)+1, lineHeight+1, 6);
|
||||
faux.draw_text(-1, i*lineHeight, line);
|
||||
faux.draw_rect(0, 1+i*lineHeight, 4*(line.length+1)+1, lineHeight+1, 0);
|
||||
faux.draw_text(-1, 1+i*lineHeight, line);
|
||||
});
|
||||
}
|
||||
|
||||
const draw = () => {
|
||||
clearScreen();
|
||||
|
||||
drawTextAbove();
|
||||
|
||||
faux.draw_rect(0, textLinesAbove.length*lineHeight, 4*(2+maxLineLen+1)+1, lineHeight+1, 6);
|
||||
faux.draw_rect(0, 1+textLinesAbove.length*lineHeight, 4*(2+maxLineLen+1)+1, lineHeight+1, 0);
|
||||
faux.draw_rect((2+index)*4, textLinesAbove.length*lineHeight+1, 4, lineHeight-1, 3);
|
||||
faux.draw_text(-1, textLinesAbove.length*lineHeight, "> "+currentLine);
|
||||
faux.draw_text(-1, 1+textLinesAbove.length*lineHeight, "> "+currentLine);
|
||||
}
|
||||
|
||||
export const repl = {
|
||||
|
Reference in New Issue
Block a user