Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dot operator with functions which put user into insert mode #3126

Open
SevereOverfl0w opened this issue Jul 1, 2018 · 0 comments
Open

Dot operator with functions which put user into insert mode #3126

SevereOverfl0w opened this issue Jul 1, 2018 · 0 comments

Comments

@SevereOverfl0w
Copy link

This looks related to #202 but I don't think this aspect of it was resolved.

Using the setup:

function! CustomChange(type, ...)
  if a:0  " Invoked from Visual mode, use gv command.
    silent exe "normal! gvd"
  elseif a:type == 'line'
    silent exe "normal! '[V']d"
  else
    silent exe "normal! `[v`]d"
  endif

  call feedkeys('i')
endfunction

nmap <silent> <F4> :set opfunc=CustomChange<CR>g@

When doing . on another word after running <F4>iwfoo<ESC> the text under the cursor is not replaced with "foo", but instead foo is inserted where the cursor is.

The same happens for various other feedkeys() I have tried, with different modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant