Closed alerque closed 4 years ago
<Esc>
?So far I haven't been able to get this down to a minimal example. It still happens all the time in production (I have to disable it most days) but I can't figurue out what the minimal conditions are.
No I don't have any custom maps for triggering Escape.
Is there any kind of debug logging I can turn on to see what happens during the time between activating a binding an my buffer being gone? This is happening often enough if there was something I could enable to get debug info I'm sure I could sit down and make it fail.
How about using :h verbose
(and :h verbosefile
)?
I think this is a minimal reproducing.
" setting
let g:asterisk#keeppos = 1
map z* <Plug>(asterisk-z*)
Steps below.
$ vim
:new a<CR>
:new b<CR>
ifoo<ESC>
z*
( New-lines are ignored. )
After this, the buffer is changed to a
but expected to stay in b
.
Is this author's case ?
@LumaKernel Yup that's pretty much it.
I still cannot reproduce it.
" Put this vimrc and start vim at the root of vim-asterisk plugin.
execute "set rtp+=" . getcwd()
let g:asterisk#keeppos = 1
map z* <Plug>(asterisk-z*)
$ vim -N -u issue34.vimrc
:new a<CR>
:new b<CR>
ifoo<ESC>
z*
How about using :h verbose (and :h verbosefile)?
Can you try this as above to understand why the buffer is closed?
@haya14busa Neovim here.
I can't get that minimum example to reproduce either. It happens enough in the wild but not in that MRE for me.
That reproducing steps is including some another options. ( Sorry, I though they doesn't effect. ) I'll try to get minimum options.
set splitbelow
set hidden
let &rtp .= ',' .. getcwd()
let g:asterisk#keeppos = 1
map z* <Plug>(asterisk-z*)
new a
new b
exe "normal! iabc\<ESC>"
normal z*
" now, current buffer is not b
How about this?
EDIT : Sorry, this is bad....
@alerque Please let me know whether you're using splitbelow/splitright
.
@LumaKernel Negative, the only thing I see that might be related to your question is set inccommand=split
.
You can see my full RC file here.
The versions I tested with {vim} -u issue34.vimrc
below.
set hidden
let &rtp .= ',' .. getcwd()
let g:asterisk#keeppos = 1
map z* <Plug>(asterisk-z*)
I realized that this is only happening with neovim.
Probably there could be a bug / an incompatible change in neovim.
What will happen when you type m`
and <C-o>
without moving cursor between the both commands?
In Vim, the cursor won't move and <C-o>
consume 1 jumplist internally.
Cursor will move !! Then, this is Neovim's bug...? Sorry for my poor understanding about |jumplist|...
For now, I make an issue to neovim.
According to https://github.com/neovim/neovim/issues/10825 https://github.com/neovim/neovim/issues/9874#issuecomment-481369640, this behavior is a specification for neovim and recommended to use ``
...
As I commented https://github.com/neovim/neovim/issues/9874#issuecomment-581501666, I strongly believe neovim behavior is weird and should be fixed, but I merged #36 to fix this issue for now.
Thank you @LumaKernel for the fix and investigation :+1:
After using (and loving!) this plugin for a while, I've reluctantly had to disable my bindings to it. I was having a problem with buffers suddenly closing on me and finally realized it was triggered by
*
motions (in my case bound to<Plug>(asterisk-z*)
.A little bit of poking showed in typically happened on the first run in a new tab or buffer, it would typically work if I opened up the buffer and tried again, and it typically worked thereafter until I switched buffers or opened something new. Then it was likely to crash again.
I don't know how to get useful debug information as the buffer just disappears and no messages are shown but I'd be happy to try something if there is a way to get any error being reported.
I'm using Neovim and vim-plug, and other than bindings my only setting is: