1. Audrius Kažukauskas
  2. dotvim

Commits

Audrius Kažukauskas  committed ca708e1

Upgrade to BufExplorer 7.3.6.

  • Participants
  • Parent commits 55f9c85
  • Branches default

Comments (0)

Files changed (2)

File doc/bufexplorer.txt

View file
  • Ignore whitespace
-*bufexplorer.txt*              Buffer Explorer       Last Change: 08 Feb 2013
+*bufexplorer.txt*              Buffer Explorer       Last Change: 06 May 2013
 
 Buffer Explorer                                *buffer-explorer* *bufexplorer*
-                                Version 7.3.5
+                                Version 7.3.6
 
 Plugin for easily exploring (or browsing) Vim|:buffers|.
 
 ===============================================================================
 CHANGE LOG                                              *bufexplorer-changelog*
 
+7.3.6    May, 06, 2013
+    * Removed the 'drop' window command that was causing issue with the
+      argument-list being modified after the BufExplorer windows was
+      displayed.
 7.3.5    February 08, 2013
     * Michael Henry added the ability to view "No Name" buffers.  This
       functionality was lost since version 7.3.0.  He also did some removal of

File plugin/bufexplorer.vim

View file
  • Ignore whitespace
 " Name Of File: bufexplorer.vim
 "  Description: Buffer Explorer Vim Plugin
 "   Maintainer: Jeff Lanzarotta (delux256-vim at yahoo dot com)
-" Last Changed: Friday, 08 Feb 2013
+" Last Changed: Monday, 06 May 2013
 "      Version: See g:bufexplorer_version for version number.
 "        Usage: This file should reside in the plugin directory and be
 "               automatically sourced.
 "2}}}
 
 " Version number
-let g:bufexplorer_version = "7.3.5"
+let g:bufexplorer_version = "7.3.6"
 
 " Check for Vim version {{{2
 if v:version < 700
 endif
 
 " Create commands {{{2
-command! BufExplorer :call BufExplorer(has ("gui") ? "drop" : "hide edit")
+command! BufExplorer :call BufExplorer()
 command! BufExplorerHorizontalSplit :call BufExplorerHorizontalSplit()
 command! BufExplorerVerticalSplit :call BufExplorerVerticalSplit()
 
 function! s:Set(var, default)
     if !exists(a:var)
         if type(a:default)
-            exec "let" a:var "=" string(a:default)
+            execute "let" a:var "=" string(a:default)
         else
-            exec "let" a:var "=" a:default
+            execute "let" a:var "=" a:default
         endif
 
         return 1
         autocmd BufEnter,BufNew * call s:ActivateBuffer()
         autocmd BufWipeOut * call s:DeactivateBuffer(1)
         autocmd BufDelete * call s:DeactivateBuffer(0)
-
         autocmd BufWinEnter \[BufExplorer\] call s:Initialize()
         autocmd BufWinLeave \[BufExplorer\] call s:Cleanup()
-
         autocmd TabEnter * call s:TabEnter()
-
         autocmd SessionLoadPost * call s:Reset()
     augroup END
 endfunction
     let s:tabSpace = []
     let i = 0
 
-    while( tabpagenr('$') > 0 && i <= tabpagenr('$') )
+    while(tabpagenr('$') > 0 && i <= tabpagenr('$'))
         call add(s:tabSpace, [-1])
         let i = i + 1
     endwhile
 " BufExplorerHorizontalSplit {{{2
 function! BufExplorerHorizontalSplit()
     let s:splitMode = "sp"
-    exec "BufExplorer"
+    execute "BufExplorer"
 endfunction
 
 " BufExplorerVerticalSplit {{{2
 function! BufExplorerVerticalSplit()
     let s:splitMode = "vsp"
-    exec "BufExplorer"
+    execute "BufExplorer"
 endfunction
 
 " BufExplorer {{{2
-function! BufExplorer(open)
+function! BufExplorer()
     let name = s:name
 
     if !has("win32")
     if s:running == 1
         " Go to the open buffer.
         if has("gui")
-            exec "drop" name
+            execute "drop" name
         endif
 
         return
 
         " Set the setting to ours.
         let [&splitbelow, &splitright] = [g:bufExplorerSplitBelow, g:bufExplorerSplitRight]
-
-        let _size = (s:splitMode == "sp") ? g:bufExplorerSplitHorzSize : g:bufExplorerSplitVertSize
+        let _size = (s:splitMode == 'sp') ? g:bufExplorerSplitHorzSize : g:bufExplorerSplitVertSize
 
         " Split the window either horizontally or vertically.
         if _size <= 0
         let [&splitbelow, &splitright] = [_splitbelow, _splitright]
     endif
 
-    if !exists("b:displayMode") || b:displayMode != "winmanager"
+    if !exists('b:displayMode') || b:displayMode != 'winmanager'
         " Do not use keepalt when opening bufexplorer to allow the buffer that
         " we are leaving to become the new alternate buffer
-        exec "silent keepjumps ".a:open." ".name
+        execute 'silent keepjumps hide edit'.name
     endif
 
     call s:DisplayBufferList()
     " Position the cursor in the newly displayed list on the line representing
     " the active buffer.  The active buffer is the line with the '%' character
     " in it.
-    execute search("%")
+    execute search('%')
 endfunction
 
 " DisplayBufferList {{{2
     call s:SetupSyntax()
     call s:MapKeys()
 
-"NEW
     " Wipe out any existing lines in case BufExplorer buffer exists and the
     " user had changed any global settings that might reduce the number of
     " lines needed in the buffer.
     keepjumps 1,$d _
-"NEW
 
     call setline(1, s:CreateHelp())
     call s:BuildBufferList()
     nnoremap <script> <silent> <buffer> u             :call <SID>ToggleShowUnlisted()<CR>
 
     for k in ["G", "n", "N", "L", "M", "H"]
-        exec "nnoremap <buffer> <silent>" k ":keepjumps normal!" k."<CR>"
+        execute "nnoremap <buffer> <silent>" k ":keepjumps normal!" k."<CR>"
     endfor
 endfunction
 
 
     " Remove old header.
     if (s:firstBufferLine > 1)
-        exec "keepjumps 1,".(s:firstBufferLine - 1) "d _"
+        execute "keepjumps 1,".(s:firstBufferLine - 1) "d _"
     endif
 
     call append(0, s:CreateHelp())
             continue
         endif
 
+        " Are we to show only buffer(s) for this tab?
         if (g:bufExplorerShowTabBuffer)
             let show_buffer = 0
 
 
         let line = buf.attributes." "
 
-        if g:bufExplorerSplitOutPathName
+        " Are we to split the path and file name?
+        if (g:bufExplorerSplitOutPathName)
             let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path"
             let path = buf[type]
             let pad  = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname
     endfor
 
     call setline(s:firstBufferLine, lines)
-
     call s:SortListing()
 endfunction
 
 
     " Are we on a line with a file name?
     if line('.') < s:firstBufferLine
-        exec "normal! \<CR>"
+        execute "normal! \<CR>"
         return
     endif
 
             " Yes, we are to open the selected buffer in a tab.
 
             " Restore [BufExplorer] buffer.
-            exec "keepjumps silent buffer!".s:originBuffer
+            execute "keepjumps silent buffer!".s:originBuffer
 
             " Get the tab nmber where this bufer is located in.
             let tabNbr = s:GetTabNbr(_bufNbr)
             " Was the tab found?
             if tabNbr == 0
                 " _bufNbr is not opened in any tabs. Open a new tab with the selected buffer in it.
-                exec "999tab split +buffer" . _bufNbr
+                execute "999tab split +buffer" . _bufNbr
             else
                 " The _bufNbr is already opened in a tab, go to that tab.
-                exec tabNbr . "tabnext"
+                execute tabNbr . "tabnext"
 
                 " Focus window.
-                exec s:GetWinNbr(tabNbr, _bufNbr) . "wincmd w"
+                execute s:GetWinNbr(tabNbr, _bufNbr) . "wincmd w"
             endif
         else
             " No, the user did not ask to open the selected buffer in a tab.
 
             " Are we suppose to move to the tab where the active buffer is?
             if exists("g:bufExplorerChgWin")
-                exe g:bufExplorerChgWin."wincmd w"
+                execute g:bufExplorerChgWin."wincmd w"
             elseif bufloaded(_bufNbr) && g:bufExplorerFindActive
                 call s:Close()
 
                 " Was the tab found?
                 if tabNbr != 0
                     " Yes, the buffer is located in a tab. Go to that tab number.
-                    exec tabNbr . "tabnext"
+                    execute tabNbr . "tabnext"
                 else
                     "Nope, the buffer is not in a tab. Simply switch to that
                     "buffer.
                     let _bufName = expand("#"._bufNbr.":p")
-                    exec _bufName ? "drop ".escape(_bufName, " ") : "buffer "._bufNbr
+                    execute _bufName ? "drop ".escape(_bufName, " ") : "buffer "._bufNbr
                 endif
             endif
 
             " Switch to the buffer.
-            exec "keepalt keepjumps silent b!" _bufNbr
+            execute "keepalt keepjumps silent b!" _bufNbr
         endif
 
         " Make the buffer 'listed' again.
     try
         " Wipe/Delete buffer from Vim.
         if a:mode == "wipe"
-            exe "silent bwipe" a:buf
+            execute "silent bwipe" a:buf
         else
-            exe "silent bdelete" a:buf
+            execute "silent bdelete" a:buf
         endif
 
         " Delete the buffer from the list on screen.
 
     " If we needed to split the main window, close the split one.
     if (s:splitMode != "")
-        exec "wincmd c"
+        execute "wincmd c"
     endif
 
     " Check to see if there are anymore buffers listed.
     if len(listed) == 0
         " Since there are no buffers left to switch to, open a new empty
         " buffers.
-        exe "enew"
+        execute "enew"
     else
-        " Since there are buffers left to switch to, swith to them...
+        " Since there are buffers left to switch to, swith to the previous and
+        " then the current.
         for b in reverse(listed[0:1])
-            exec "keepjumps silent b ".b
+            execute "keepjumps silent b ".b
         endfor
     endif
 
 
     if a:0 && a:000[0] && (line('$') >= s:firstBufferLine)
         " Clear the list first.
-        exec "keepjumps ".s:firstBufferLine.',$d _'
+        execute "keepjumps ".s:firstBufferLine.',$d _'
     endif
 
     let num_bufs = s:BuildBufferList()
 
     if g:bufExplorerSortBy == "number"
         " Easiest case.
-        exec sort 'n'
+        execute sort 'n'
     elseif g:bufExplorerSortBy == "name"
         if g:bufExplorerSplitOutPathName
-            exec sort 'ir /\d.\{7}\zs\f\+\ze/'
+            execute sort 'ir /\d.\{7}\zs\f\+\ze/'
         else
-            exec sort 'ir /\zs[^\/\\]\+\ze\s*line/'
+            execute sort 'ir /\zs[^\/\\]\+\ze\s*line/'
         endif
     elseif g:bufExplorerSortBy == "fullpath"
         if g:bufExplorerSplitOutPathName
             " Sort twice - first on the file name then on the path.
-            exec sort 'ir /\d.\{7}\zs\f\+\ze/'
+            execute sort 'ir /\d.\{7}\zs\f\+\ze/'
         endif
 
-        exec sort 'ir /\zs\f\+\ze\s\+line/'
+        execute sort 'ir /\zs\f\+\ze\s\+line/'
     elseif g:bufExplorerSortBy == "extension"
-        exec sort 'ir /\.\zs\w\+\ze\s/'
+        execute sort 'ir /\.\zs\w\+\ze\s/'
     elseif g:bufExplorerSortBy == "mru"
         let l = getline(s:firstBufferLine, "$")
 
 
     let nlines = min([line("$"), g:bufExplorerMaxHeight])
 
-    exe nlines." wincmd _"
+    execute nlines." wincmd _"
 
     " The following lines restore the layout so that the last file line is also
     " the last window line. Sometimes, when a line is deleted, although the
     " the lines are pushed up and we see some lagging '~'s.
     let pres = getpos(".")
 
-    exe $
+    execute $
 
     let _scr = &scrolloff
     let &scrolloff = 0