Skip to content

Commit

Permalink
Make sure to save the file list when removing outdated files
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtom committed Nov 27, 2012
1 parent a9a6103 commit ed1dcde
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugin/tmru.vim
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-04-13. " @Created: 2007-04-13.
" @Last Change: 2012-11-27. " @Last Change: 2012-11-27.
" @Revision: 709 " @Revision: 711
" GetLatestVimScripts: 1864 1 tmru.vim " GetLatestVimScripts: 1864 1 tmru.vim


if &cp || exists("loaded_tmru") if &cp || exists("loaded_tmru")
Expand Down Expand Up @@ -257,7 +257,8 @@ endf
function! s:MruStore(mru, props) function! s:MruStore(mru, props)
" TLogVAR g:tmru_file " TLogVAR g:tmru_file
let tmru_list = s:MruSort(a:mru)[0 : g:tmruSize] let tmru_list = s:MruSort(a:mru)[0 : g:tmruSize]
if get(a:props, 'save', 1) && tmru_list != s:tmru_list let save = get(a:props, 'save', 1)
if save == 2 || (save && tmru_list != s:tmru_list)
let s:tmru_list = tmru_list let s:tmru_list = tmru_list
" TLogVAR g:TMRU " TLogVAR g:TMRU
" TLogVAR g:tmru_file " TLogVAR g:tmru_file
Expand Down Expand Up @@ -376,8 +377,9 @@ function! s:SelectMRU()
endif endif
endif endif
endfor endfor
" TLogVAR modified_mru
if modified_mru > 0 if modified_mru > 0
call s:MruStore(mru0, {}) call s:MruStore(mru0, {'save': 2})
endif endif
return modified_mru < len(bs) return modified_mru < len(bs)
endif endif
Expand Down Expand Up @@ -619,7 +621,7 @@ function! s:CheckFilenames(world, selected) "{{{3
let idx -= 1 let idx -= 1
endwh endwh
if unreadable > 0 || dupes > 0 || normalized > 0 if unreadable > 0 || dupes > 0 || normalized > 0
call s:MruStore(mru, {}) call s:MruStore(mru, {'save': 2})
echom "TMRU: Removed" unreadable "unreadable and" dupes "duplicate" echom "TMRU: Removed" unreadable "unreadable and" dupes "duplicate"
\ "files from mru list, and normalized" normalized "entries." \ "files from mru list, and normalized" normalized "entries."
endif endif
Expand Down

0 comments on commit ed1dcde

Please sign in to comment.