From 71cc2ef765f18ab150bf834993c0e90a68797629 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Fri, 11 Jun 2010 00:13:54 +0200 Subject: [PATCH] Bug fix: Expand ~ to $HOME manually on Win32 While testing the plug-in on Microsoft Windows I found out that ~ in the &tags option isn't expanded to $HOME by either Vim or Ctags. Unfortunately while committing all of my fixes to get Windows support working (a few commits ago) I seem to have lost this fix. While testing this fix again I now notice the tags file getting corrupted in my Windows XP virtual machine -- more debugging to do. --- easytags.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/easytags.vim b/easytags.vim index 0b61721..41387d7 100644 --- a/easytags.vim +++ b/easytags.vim @@ -82,10 +82,15 @@ let s:expanded = map(copy(s:tagfiles), 'expand(v:val)') " Add the tags file to the &tags option when the user hasn't done so already. if index(s:expanded, expand(g:easytags_file)) == -1 - let &tags = xolox#option#join_tags(insert(s:tagfiles, g:easytags_file, 0)) + let s:entry = g:easytags_file + if (has('win32') || has('win64')) && s:entry =~ '^\~[\\/]' + " On UNIX you can use ~/ in &tags but on Windows that doesn't work. + let s:entry = expand(s:entry) + endif + let &tags = xolox#option#join_tags(insert(s:tagfiles, s:entry, 0)) endif -unlet s:tagfiles s:expanded +unlet s:tagfiles s:expanded s:entry " The :UpdateTags and :HighlightTags commands. {{{1