Skip to content
New issue

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

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

Already on GitHub? # to your account

MBEbd error when only two buffers exsit #145

Open
madjxatw opened this issue Jan 15, 2016 · 4 comments
Open

MBEbd error when only two buffers exsit #145

madjxatw opened this issue Jan 15, 2016 · 4 comments

Comments

@madjxatw
Copy link

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
@jiacj
Copy link

jiacj commented Apr 9, 2016

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

@FranciscoDA
Copy link

FranciscoDA commented Jan 7, 2017

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

@j3soon
Copy link

j3soon commented Jun 16, 2017

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.

@Shadowalker1995
Copy link

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!

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

No branches or pull requests

5 participants