Skip to content

Commit 76eb6f4

Browse files
committed
test: update empty insert escape cursor expectation
1 parent fd13746 commit 76eb6f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/opencode/test/cli/tui/vim-motions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,15 +1142,15 @@ describe("vim motion handler", () => {
11421142
expect(ctx.textarea.cursorOffset).toBe(1)
11431143
})
11441144

1145-
test("escape from insert leaves cursor inside line content alone", () => {
1145+
test("escape from empty insert moves cursor back like vim", () => {
11461146
const ctx = createHandler("abc")
11471147
ctx.textarea.cursorOffset = 1
11481148
expect(ctx.handler.handleKey(createEvent("i").event)).toBe(true)
11491149
expect(ctx.state.mode()).toBe("insert")
11501150

11511151
expect(ctx.handler.handleKey(createEvent("escape").event)).toBe(true)
11521152
expect(ctx.state.mode()).toBe("normal")
1153-
expect(ctx.textarea.cursorOffset).toBe(1)
1153+
expect(ctx.textarea.cursorOffset).toBe(0)
11541154
})
11551155

11561156
test("o opens line below and enters insert", () => {

0 commit comments

Comments
 (0)