MBEbd error when only two buffers exsit
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
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
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
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.
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:890if l:currWin <= winnr('$') call s:SwitchWindow('w',1,l:currWin) endifOf course, you could also just leave the MBE window always open with :MBEOpen :P
Awesome. Your solution solves my same problem well. Thank you!