mtth / scratch.vim

Unobtrusive scratch window
MIT License
395 stars 32 forks source link

Does not read persistent file #28

Closed karamellpelle closed 6 years ago

karamellpelle commented 6 years ago

I've set the persistent file in my vimrc:

let g:scratch_persistence_file = "~/.vim/scratch.vim"

After writing to the scratch (gs, write, <Esc>), and after closing vim, the scratch file has the correct content. When I restart vim, my scratch file is still correct. When starting a scratch with gs the scratch window is empty. But the scratch file is still correct. The scratch file becomes different is just when the scratch window is closed, i.e. escaping insert mode.

Do you know what's going on?

mtth commented 6 years ago

I think it's because ~ isn't supported by filereadable (it'll work if you enter the file's dereferenced path); I'll submit a PR to work around this.

mtth commented 6 years ago

Fixed in 98976ad2a0342784740db27e4353be892c8a2053.

karamellpelle commented 6 years ago

Pulled into my vim git repository and works well! Thank you