From 37297ddae675d0727ec3f1e0e560cc2dd5a0c4de Mon Sep 17 00:00:00 2001 From: Amir Salihefendic Date: Sat, 31 Mar 2018 11:52:11 -0300 Subject: [PATCH] Fixed https://github.com/amix/vimrc/issues/370 --- vimrcs/basic.vim | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index 6c3d6dd3..a0c52a4a 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -356,28 +356,26 @@ endfunction " Don't close window, when deleting a buffer command! Bclose call BufcloseCloseIt() function! BufcloseCloseIt() - let l:currentBufNum = bufnr("%") - let l:alternateBufNum = bufnr("#") + let l:currentBufNum = bufnr("%") + let l:alternateBufNum = bufnr("#") - if buflisted(l:alternateBufNum) - buffer # - else - bnext - endif + if buflisted(l:alternateBufNum) + buffer # + else + bnext + endif - if bufnr("%") == l:currentBufNum - new - endif + if bufnr("%") == l:currentBufNum + new + endif - if buflisted(l:currentBufNum) - execute("bdelete! ".l:currentBufNum) - endif + if buflisted(l:currentBufNum) + execute("bdelete! ".l:currentBufNum) + endif endfunction function! CmdLine(str) - exe "menu Foo.Bar :" . a:str - emenu Foo.Bar - unmenu Foo + call feedkeys(":" . a:str) endfunction function! VisualSelection(direction, extra_filter) range