Skip to content

<c-o>u inserts 'zv' into the buffer #101

Description

@Bricktech2000

In insert mode, after performing an undoable change like hitting <cr>, typing <c-o>u will undo the change as expected but will then insert 'zv' into the buffer.

  • Vim version: 9.1; Included patches: 1-1566
  • Plugin version: 6584602

The issue appears to be that the plugin maps u to a sequence of normal-mode commands, and because of <c-o> only the first command is executed in normal mode; the rest of the typeahead is processed by insert mode.

function! repeat#wrap(command,count)
let foldopen = &foldopen =~# 'undo\|all' ? 'zv' : ''
let preserve = g:repeat_tick == b:changedtick ? ":let g:repeat_tick = b:changedtick\r" : ''
return (a:count ? a:count : '') . a:command . preserve . foldopen
endfunction

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions