opencode-vim
Advanced tools
+1
-1
| { | ||
| "name": "opencode-vim", | ||
| "version": "0.0.14", | ||
| "version": "0.0.15", | ||
| "exports": { | ||
@@ -5,0 +5,0 @@ "./tui": { |
@@ -159,3 +159,3 @@ /** @jsxImportSource @opentui/solid */ | ||
| if (!isPromptFocused(ctx)) return navigationKey(key) | ||
| if (!isSlashCommandToken(ctx)) return undefined | ||
| if (!isNativeCompletionToken(ctx)) return undefined | ||
| if (key === "j") return arrowKey("down", "\u001B[B") | ||
@@ -170,8 +170,8 @@ if (key === "k") return arrowKey("up", "\u001B[A") | ||
| function isSlashCommandToken(ctx: PromptContext) { | ||
| function isNativeCompletionToken(ctx: PromptContext) { | ||
| const text = ctx.prompt()?.current.input ?? focusedInput(ctx)?.plainText ?? "" | ||
| if (!text.startsWith("/")) return false | ||
| const input = focusedInput(ctx) | ||
| const offset = Math.max(0, input?.cursorOffset ?? text.length) | ||
| return !/\s/.test(text.slice(0, Math.min(offset + 1, text.length))) | ||
| const beforeCursor = text.slice(0, Math.min(offset + 1, text.length)) | ||
| return /^\/\S*$/.test(beforeCursor) || /(?:^|\s)@\S*$/.test(beforeCursor) | ||
| } | ||
@@ -178,0 +178,0 @@ |
1148948
0