Use alphabetic characters, so button symbols can be used as identifiers

This commit is contained in:
dylan
2023-05-09 08:19:20 -07:00
parent 2ac5f3dff7
commit 1211891f53
3 changed files with 35 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
import { clearScreen, fillRect } from "./window.ts";
import { font } from "./font.ts";
import { CHAR, font } from "./font.ts";
import { drawText, measureText } from "./builtins.ts";
import { COLOR } from "./colors.ts";
import { getCodeSheet, setSheet } from "./sheet.ts";
@@ -159,15 +159,19 @@ const tokenColors = {
}
const transformForCopy = (text: string) => {
text = text.replaceAll("➡", "");
text = text.replaceAll("⬅", "⬅️");
text = text.replaceAll("⬇", "⬇️");
text = text.replaceAll("⬆", "");
text = text.replaceAll(CHAR.UP, "");
text = text.replaceAll(CHAR.LEFT, "⬅️");
text = text.replaceAll(CHAR.DOWN, "⬇️");
text = text.replaceAll(CHAR.RIGHT, "");
return text;
}
const transformForPaste = (text: string) => {
let newstr = "";
text = text.replaceAll("⬆️", CHAR.UP);
text = text.replaceAll("⬅️", CHAR.LEFT);
text = text.replaceAll("⬇️", CHAR.DOWN);
text = text.replaceAll("➡️", CHAR.RIGHT);
for (const char of text) {
if (char in font.chars) {
newstr += char;