Skip to content

Commit f7e9f73

Browse files
committed
fix text object yank cursor
1 parent aa701f0 commit f7e9f73

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/modules/vim/vimee.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,12 @@ export function createVimeeAdapter(state: VimState, config: VimConfig, log: VimL
250250
}
251251
if (!textObjectOperator(vim.operator)) return undefined
252252

253+
const originalCursor = vim.cursor
253254
const result = executeTextObject(vim.operator, range, buffer, vim)
255+
if (vim.operator === "y") {
256+
result.context = { ...result.context, cursor: originalCursor }
257+
result.actions = result.actions.map((action) => (action.type === "cursor-move" ? { ...action, position: originalCursor } : action))
258+
}
254259
vim = result.context
255260
applyActions(result.actions, ctx, map)
256261
if (flashRange) flashYank(ctx, activeMap, { type: "yank", text: result.yankedText }, flashRange)

0 commit comments

Comments
 (0)