opencode-vim 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -156,7 +156,7 @@ function snippetNavigationDelta(key: string) {
|
|
|
156
156
|
|
|
157
157
|
function commandNavigationKey(ctx: PromptContext, key: string): ParsedKey | undefined {
|
|
158
158
|
if (!isPromptFocused(ctx)) return navigationKey(key)
|
|
159
|
-
if (!
|
|
159
|
+
if (!isNativeCompletionToken(ctx)) return undefined
|
|
160
160
|
if (key === "j") return arrowKey("down", "\u001B[B")
|
|
161
161
|
if (key === "k") return arrowKey("up", "\u001B[A")
|
|
162
162
|
return undefined
|
|
@@ -166,12 +166,12 @@ function isPromptFocused(ctx: PromptContext) {
|
|
|
166
166
|
return ctx.prompt()?.focused === true && !!focusedInput(ctx)
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
function
|
|
169
|
+
function isNativeCompletionToken(ctx: PromptContext) {
|
|
170
170
|
const text = ctx.prompt()?.current.input ?? focusedInput(ctx)?.plainText ?? ""
|
|
171
|
-
if (!text.startsWith("/")) return false
|
|
172
171
|
const input = focusedInput(ctx)
|
|
173
172
|
const offset = Math.max(0, input?.cursorOffset ?? text.length)
|
|
174
|
-
|
|
173
|
+
const beforeCursor = text.slice(0, Math.min(offset + 1, text.length))
|
|
174
|
+
return /^\/\S*$/.test(beforeCursor) || /(?:^|\s)@\S*$/.test(beforeCursor)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
function navigationKey(key: string): ParsedKey | undefined {
|