Add basic completion support, increase editor/term sizes

This commit is contained in:
Quinten Kock 2025-11-30 00:56:48 +01:00
parent 8d935eb90e
commit f0520ebbdc
3 changed files with 9 additions and 6 deletions

View File

@ -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

View File

@ -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(),

View File

@ -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);