diff options
author | Peter Odding <peter@peterodding.com> | 2010-06-11 00:13:54 +0200 |
---|---|---|
committer | Peter Odding <peter@peterodding.com> | 2010-06-11 00:13:54 +0200 |
commit | 71cc2ef765f18ab150bf834993c0e90a68797629 (patch) | |
tree | 7cba2f939f287d6b345d9a11edce404ec5a5be1a | |
parent | 1c8733ee23d792bf5f7c325f6e5babec14f798f2 (diff) | |
download | vim-easytags-71cc2ef765f18ab150bf834993c0e90a68797629.tar.gz |
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.
-rw-r--r-- | easytags.vim | 9 |
1 files 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 |