Add basic completion support, increase editor/term sizes
This commit is contained in:
parent
8d935eb90e
commit
f0520ebbdc
|
|
@ -6,5 +6,6 @@ Its primary goal is to provide the user with a stack/column-based navigation his
|
||||||
## Features
|
## Features
|
||||||
- [x] Basic file editing
|
- [x] Basic file editing
|
||||||
- [x] Terminal integration
|
- [x] Terminal integration
|
||||||
- [ ] File watching
|
- [x] File watching (note: slow!)
|
||||||
|
- [ ] Warn on exit when there are unsaved files
|
||||||
- [ ] LSP support
|
- [ ] LSP support
|
||||||
|
|
@ -4,6 +4,7 @@ import {
|
||||||
Extension,
|
Extension,
|
||||||
StateEffect,
|
StateEffect,
|
||||||
StateField,
|
StateField,
|
||||||
|
EditorState,
|
||||||
} from "@codemirror/state";
|
} from "@codemirror/state";
|
||||||
import {
|
import {
|
||||||
EditorView,
|
EditorView,
|
||||||
|
|
@ -28,6 +29,7 @@ import {
|
||||||
foldKeymap,
|
foldKeymap,
|
||||||
} from "@codemirror/language";
|
} from "@codemirror/language";
|
||||||
import { languages } from "@codemirror/language-data";
|
import { languages } from "@codemirror/language-data";
|
||||||
|
import { autocompletion, closeBrackets } from "@codemirror/autocomplete";
|
||||||
import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
|
import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
|
||||||
import van from "vanjs-core";
|
import van from "vanjs-core";
|
||||||
|
|
||||||
|
|
@ -40,7 +42,7 @@ const fixedHeightEditor = EditorView.theme({
|
||||||
minHeight: "1em",
|
minHeight: "1em",
|
||||||
resize: "horizontal",
|
resize: "horizontal",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
width: "600px",
|
width: "768px",
|
||||||
minWidth: "8em",
|
minWidth: "8em",
|
||||||
flex: "none",
|
flex: "none",
|
||||||
fontSize: "16px",
|
fontSize: "16px",
|
||||||
|
|
@ -132,11 +134,11 @@ export class Editor implements Displayable {
|
||||||
foldGutter(),
|
foldGutter(),
|
||||||
drawSelection(),
|
drawSelection(),
|
||||||
dropCursor(),
|
dropCursor(),
|
||||||
// allowMultipleSelections,
|
EditorState.allowMultipleSelections.of(true),
|
||||||
indentOnInput(),
|
indentOnInput(),
|
||||||
bracketMatching(),
|
bracketMatching(),
|
||||||
// closeBrackets,
|
closeBrackets(),
|
||||||
// autocompletion,
|
autocompletion(),
|
||||||
rectangularSelection(),
|
rectangularSelection(),
|
||||||
crosshairCursor(),
|
crosshairCursor(),
|
||||||
highlightActiveLine(),
|
highlightActiveLine(),
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export class Terminal implements Displayable {
|
||||||
this.fitAddon = new FitAddon();
|
this.fitAddon = new FitAddon();
|
||||||
this.term.loadAddon(this.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());
|
this.dom.addEventListener("focusin", () => this.focus());
|
||||||
|
|
||||||
const loaded = van.state(false);
|
const loaded = van.state(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue