minibufexpl.vim icon indicating copy to clipboard operation
minibufexpl.vim copied to clipboard

MBEbd error when only two buffers exsit

Open madjxatw opened this issue 9 years ago • 4 comments

If there are only two buffers exist, use of MBEbd throws the error as shown below:

Error detected while processing function <SNR>43_DeleteBuffer..<SNR>43_UpdateExplorer..<SNR>43_SwitchWindow:
line   24:
E16: Invalid range: noautocmd 2wincmd w

madjxatw avatar Jan 15 '16 14:01 madjxatw

I get this error when I try to close one of two exit buf using d.

Error detected while processing function <SNR>41_MBEDeleteBuffer[13]..<SNR>41_DeleteBuffer[67]..<SNR>41_UpdateExplorer[44]..<SNR>41_SwitchWindow:
line   24:
E16: Invalid range: noautocmd 2wincmd w

jiacj avatar Apr 09 '16 08:04 jiacj

It seems I could get around this by commenting out line 890 in minibufexpl.vim: " call s:SwitchWindow('w',1,l:currWin) I'm not sure if this could introduce other issues Edit: Disregard that, this seems to conflict with other plugins such as NERDTree :( Edit2: It seems the problem is caused by the MiniBufExplorer window toggling off when there is a single buffer left, thus the call to SwitchWindow tries to switch to a now invalid window number. To improve on my previous workaround: minibufexpl.vim:890

if l:currWin <= winnr('$')
    call s:SwitchWindow('w',1,l:currWin)
endif

Of course, you could also just leave the MBE window always open with :MBEOpen :P

FranciscoDA avatar Jan 07 '17 15:01 FranciscoDA

I get the same error while closing the current tab using d when there are a total of 2 tabs. Closing the other one doesn't throw the error.

j3soon avatar Jun 16 '17 01:06 j3soon

It seems I could get around this by commenting out line 890 in minibufexpl.vim: " call s:SwitchWindow('w',1,l:currWin) I'm not sure if this could introduce other issues Edit: Disregard that, this seems to conflict with other plugins such as NERDTree :( Edit2: It seems the problem is caused by the MiniBufExplorer window toggling off when there is a single buffer left, thus the call to SwitchWindow tries to switch to a now invalid window number. To improve on my previous workaround: minibufexpl.vim:890

if l:currWin <= winnr('$')
    call s:SwitchWindow('w',1,l:currWin)
endif

Of course, you could also just leave the MBE window always open with :MBEOpen :P

Awesome. Your solution solves my same problem well. Thank you!

Shadowalker1995 avatar Apr 30 '20 18:04 Shadowalker1995