From f0520ebbdc2cac5c6bd5c02cb17058ea4449fef0 Mon Sep 17 00:00:00 2001 From: Quinten Kock Date: Sun, 30 Nov 2025 00:56:48 +0100 Subject: [PATCH] Add basic completion support, increase editor/term sizes --- README.md | 3 ++- src/app/editor.ts | 10 ++++++---- src/app/terminal.ts | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f624e0c..024d6fb 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,6 @@ Its primary goal is to provide the user with a stack/column-based navigation his ## Features - [x] Basic file editing - [x] Terminal integration -- [ ] File watching +- [x] File watching (note: slow!) +- [ ] Warn on exit when there are unsaved files - [ ] LSP support \ No newline at end of file diff --git a/src/app/editor.ts b/src/app/editor.ts index f3674f6..7260920 100644 --- a/src/app/editor.ts +++ b/src/app/editor.ts @@ -4,6 +4,7 @@ import { Extension, StateEffect, StateField, + EditorState, } from "@codemirror/state"; import { EditorView, @@ -28,6 +29,7 @@ import { foldKeymap, } from "@codemirror/language"; import { languages } from "@codemirror/language-data"; +import { autocompletion, closeBrackets } from "@codemirror/autocomplete"; import { highlightSelectionMatches, searchKeymap } from "@codemirror/search"; import van from "vanjs-core"; @@ -40,7 +42,7 @@ const fixedHeightEditor = EditorView.theme({ minHeight: "1em", resize: "horizontal", overflow: "auto", - width: "600px", + width: "768px", minWidth: "8em", flex: "none", fontSize: "16px", @@ -132,11 +134,11 @@ export class Editor implements Displayable { foldGutter(), drawSelection(), dropCursor(), - // allowMultipleSelections, + EditorState.allowMultipleSelections.of(true), indentOnInput(), bracketMatching(), - // closeBrackets, - // autocompletion, + closeBrackets(), + autocompletion(), rectangularSelection(), crosshairCursor(), highlightActiveLine(), diff --git a/src/app/terminal.ts b/src/app/terminal.ts index b08e71d..6507879 100644 --- a/src/app/terminal.ts +++ b/src/app/terminal.ts @@ -33,7 +33,7 @@ export class Terminal implements Displayable { this.fitAddon = new FitAddon(); this.term.loadAddon(this.fitAddon); - this.dom = v.div({ class: "h-full w-lg resize-x overflow-x-hidden scroll-m-[100px]" }); + this.dom = v.div({ class: "h-full w-2xl resize-x overflow-x-hidden scroll-m-[100px]" }); this.dom.addEventListener("focusin", () => this.focus()); const loaded = van.state(false);