selection update

This commit is contained in:
2026-06-30 21:31:35 +02:00
parent 594c4c674d
commit c4300b0416
10 changed files with 402 additions and 91 deletions
+6 -7
View File
@@ -1,11 +1,12 @@
import { render } from "./render.js";
import { setupInput } from "./input.js";
import { render } from "./lib/render.js";
import { setupInput } from "./lib/keyboard.js";
const buffer = ["Hello, world!", "Second line."];
const cursor = { line: 0, col: 0 };
const selection = { anchor: null, head: null };
function onChange() {
render(buffer, cursor);
render(buffer, cursor, selection);
try {
console.log(buffer.map((line) => JSON.parse(App.testing(line))));
} catch (e) {
@@ -14,7 +15,5 @@ function onChange() {
document.getElementById("text").innerHTML += "<br>";
}
function escapeHtml(s) {}
setupInput(buffer, cursor, onChange);
render(buffer, cursor);
setupInput(buffer, cursor, selection, onChange);
render(buffer, cursor, selection);