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
|
||||
- [x] Basic file editing
|
||||
- [x] Terminal integration
|
||||
- [ ] File watching
|
||||
- [x] File watching (note: slow!)
|
||||
- [ ] Warn on exit when there are unsaved files
|
||||
- [ ] LSP support
|
||||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue