Permalink
Browse files

Version 1.6

Fixed the following bugs: Some filenames are added more than once to the MRU list and the MRU window is not closed when a file which already opened in one of the windows is selected from the MRU window.
  • Loading branch information...
1 parent 23dda88 commit 1b8432c1e0d9bab895c109f23ee97ffbacc4a402 @yegappan yegappan committed with Jul 19, 2003
Showing with 15 additions and 4 deletions.
  1. +15 −4 plugin/mru.vim
View
19 plugin/mru.vim
@@ -1,7 +1,7 @@
" File: mru.vim
" Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
-" Version: 1.5
-" Last Modified: May 19, 2003
+" Version: 1.6
+" Last Modified: July 19, 2003
"
" Overview
" --------
@@ -173,7 +173,7 @@ function! s:MRU_AddFile()
" If the filename is already present in the MRU list, then move
" it to the beginning of the list
- let idx = stridx(g:MRU_LIST, fname)
+ let idx = stridx(g:MRU_LIST, fname . "\n")
if idx != -1
let already_present = 1
@@ -243,7 +243,18 @@ function! s:MRU_EditFile(new_window)
" jump to it
let winnum = bufwinnr(fname)
if winnum != -1
- exe winnum . 'wincmd w'
+ if g:MRU_Auto_Close == 1 && g:MRU_Use_Current_Window == 0
+ " Automatically close the window if the file window is
+ " not used to display the MRU list.
+ silent! close
+ endif
+ " As the window numbers will change after closing a window,
+ " get the window number again and jump to it, if the cursor
+ " is not already in that window
+ let winnum = bufwinnr(fname)
+ if winnum != winnr()
+ exe winnum . 'wincmd w'
+ endif
else
if g:MRU_Auto_Close == 1 && g:MRU_Use_Current_Window == 0
" Automatically close the window if the file window is

0 comments on commit 1b8432c

Please sign in to comment.