Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

_restore_unnamed_register rarely fails to restore #471

Closed e-kwsm closed 5 years ago

e-kwsm commented 5 years ago

https://github.com/Shougo/neosnippet.vim/blob/3d3362622ef10deedaea8e026054064bf62aeb33/autoload/neosnippet/handlers.vim#L41-L49

seems to fail restoration for the very rare occasion.

This happens even if no snippet is expanded. See blow for detail, copied from neovim/neovim#10044.


First of all, I'm sorry but I cannot reproduce the phenomenon. This happens rarely (< once per month) for a year. I'm mainly using neovim and not sure what about vim.

Is there anybody who has similar experience?

Steps to reproduce using nvim -u NORC

An operation is something like:

  1. open file
    aaa
    bbb
  2. go to the first line and dd twice

I encounter this after dd and S, never after yank.

Actual behaviour

:registers shows

""   aaa^J
"1   bbb^J
"2   aaa^J

The unnamed register "" is not updated, p puts an older one but not the last-deleted line (bbb).

Expected behaviour

:registers should show

""   bbb^J
"1   bbb^J
"2   aaa^J

The unnamed register is updated and p puts bbb.