Add sheet viewer page
This commit is contained in:
@ -2,15 +2,16 @@ import { clearScreen, fillRect } from "./window.ts";
|
||||
import { fontWidth, fontHeight } from "./font.ts";
|
||||
import { drawText } from "./builtins.ts";
|
||||
import { COLOR } from "./colors.ts";
|
||||
import {getCodeSheet, setSheet} from "./sheet.ts";
|
||||
import { getCodeSheet, setSheet } from "./sheet.ts";
|
||||
import { K, ctrlKeyDown, getKeyboardString, keyPressed, shiftKeyDown } from "./keyboard.ts";
|
||||
import { clipboard, tokenize } from "./deps.ts";
|
||||
import { getContext } from "./runcode.ts";
|
||||
import { page } from "./viewsheets.ts";
|
||||
|
||||
const historyDebounceFrames = 20;
|
||||
|
||||
const state = {
|
||||
history: [{code: getCodeSheet(0), anchor: 0, focus: 0}],
|
||||
history: [{code: getCodeSheet(page.activeSheet), anchor: 0, focus: 0}],
|
||||
historyDebounce: 0,
|
||||
historyIndex: 0,
|
||||
undo() {
|
||||
@ -201,10 +202,10 @@ const state = {
|
||||
return match[0];
|
||||
},
|
||||
get code() {
|
||||
return getCodeSheet(0);
|
||||
return getCodeSheet(page.activeSheet);
|
||||
},
|
||||
set code(val) {
|
||||
setSheet(0, "code", val);
|
||||
setSheet(page.activeSheet, "code", val);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user