Use alphabetic characters, so button symbols can be used as identifiers
This commit is contained in:
14
codetab.ts
14
codetab.ts
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user