codeformat

This commit is contained in:
dtricks 2025-10-03 18:12:47 +02:00 committed by dtricks
parent be9368e8a2
commit 73a9834959
4 changed files with 32 additions and 29 deletions

View file

@ -13,7 +13,9 @@ const vscodePlugin = ViewPlugin.fromClass(
constructor() {} constructor() {}
}, },
{ {
provide : () => { return Prec.highest(keymap.of([...vscodeKeymap ])); }, provide: () => {
return Prec.highest(keymap.of([...vscodeKeymap]));
},
}, },
); );
const vscodeExtension = (options) => [vscodePlugin].concat(options ?? []); const vscodeExtension = (options) => [vscodePlugin].concat(options ?? []);
@ -73,9 +75,7 @@ try {
// :w to evaluate // :w to evaluate
// :w to evaluate // :w to evaluate
Vim.defineEx('write', 'w', (cm) => { Vim.defineEx('write', 'w', (cm) => {
const view = const view = cm?.view || cm; // CM6 Vim passes either an object with view or the view itself
cm?.view ||
cm; // CM6 Vim passes either an object with view or the view itself
try { try {
view?.focus?.(); view?.focus?.();
// Let the app know this came from Vim :w // Let the app know this came from Vim :w

0
packages/osc/server.js Normal file → Executable file
View file

View file

@ -8,6 +8,7 @@ layout: ../../layouts/MainLayout.astro
When the REPL editor (CodeMirror) is configured to use Vim keybindings, the following commands are available: When the REPL editor (CodeMirror) is configured to use Vim keybindings, the following commands are available:
- :w — Evaluate the current code - :w — Evaluate the current code
- Triggers the same evaluation as Ctrl+Enter / Alt+Enter - Triggers the same evaluation as Ctrl+Enter / Alt+Enter
- Youll see messages in the Console panel such as: - Youll see messages in the Console panel such as:
- [vim] :w — evaluating code - [vim] :w — evaluating code
@ -15,10 +16,12 @@ When the REPL editor (CodeMirror) is configured to use Vim keybindings, the foll
- [eval] code updated - [eval] code updated
- :q — Stop/pause playback - :q — Stop/pause playback
- Triggers the same stop action as Alt+. - Triggers the same stop action as Alt+.
- Useful to quickly stop scheduling without leaving Vim mode - Useful to quickly stop scheduling without leaving Vim mode
- gc — Toggle line comments for the current selection(s) - gc — Toggle line comments for the current selection(s)
- Works in normal and visual mode - Works in normal and visual mode
- If theres a selection, all selected lines are toggled - If theres a selection, all selected lines are toggled