Skip to content

Commit

Permalink
Fixing a serious issue where all files open with vim were renamed whe…
Browse files Browse the repository at this point in the history
…n g:pad_dir isn't properly set.
  • Loading branch information
fmoralesc committed Jan 24, 2012
1 parent 34205a8 commit 0245be4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugin/padlib/vim_globals.py
Expand Up @@ -7,9 +7,13 @@ def set_vim_globals():
""" Sets global vim preferences and commands.
"""
# To update the date when files are modified
vim.command('execute "au! BufEnter" printf("%s*", g:pad_dir) ":let b:pad_modified = 0"')
vim.command('execute "au! BufWritePre" printf("%s*", g:pad_dir) ":let b:pad_modified = eval(&modified)"')
vim.command('execute "au! BufLeave" printf("%s*", g:pad_dir) ":call pad#UpdatePad()"')
if get_save_dir() == "":
vim.command('let tmp = confirm("IMPORTANT:\n'\
'Please set g:pad_dir to a valid path in your vimrc.", "OK", 1, "Error")')
else:
vim.command('execute "au! BufEnter" printf("%s*", g:pad_dir) ":let b:pad_modified = 0"')
vim.command('execute "au! BufWritePre" printf("%s*", g:pad_dir) ":let b:pad_modified = eval(&modified)"')
vim.command('execute "au! BufLeave" printf("%s*", g:pad_dir) ":call pad#UpdatePad()"')

# vim-pad pollutes the MRU.vim list quite a lot, if let alone.
# This should fix that.
Expand Down

0 comments on commit 0245be4

Please sign in to comment.