Skip to content

Commit

Permalink
Forget about notes that are never saved
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Dec 24, 2010
1 parent 46e2978 commit 2a1a704
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions autoload.vim
Expand Up @@ -383,6 +383,13 @@ function! xolox#notes#cache_del(filename) " {{{3
endif
endfunction

function! xolox#notes#unload_from_cache() " {{{3
let bufname = expand('<afile>:p')
if !filereadable(bufname)
call xolox#notes#cache_del(bufname)
endif
endfunction

" Functions called by the file type plug-in and syntax script. {{{2

function! xolox#notes#insert_quote(style) " {{{3
Expand Down
3 changes: 2 additions & 1 deletion notes.vim
Expand Up @@ -3,7 +3,7 @@
" Last Change: December 24, 2010
" URL: http://peterodding.com/code/vim/notes/
" License: MIT
" Version: 0.7.12
" Version: 0.7.13

" Support for automatic update using the GLVS plug-in.
" GetLatestVimScripts: 3375 1 :AutoInstall: session.zip
Expand Down Expand Up @@ -60,6 +60,7 @@ augroup PluginNotes
au BufReadCmd note:* nested call xolox#notes#shortcut()
au SwapExists * call xolox#notes#swaphack()
au WinEnter * if &ft == 'notes' | call xolox#notes#highlight_names() | endif
au BufUnload * if &ft == 'notes' | call xolox#notes#unload_from_cache() | endif
call s:DefAutoCmd('BufWritePost', g:notes_directory, 'call xolox#notes#cleanup()')
augroup END

Expand Down

0 comments on commit 2a1a704

Please sign in to comment.