Дмитрий Франк wrote:
I found bug in Vim 7.3 when using on Windows.
I trying to put tag file in "~\tags". but there's spaces in home
directory: "C:\Documents and Settings\Username".

When i typing ":new ~\tags", it opens.
But filereadable('~\tags') returns false (0).

I think filereadable('~\tags') isn't supposed to work, it doesn't work on UNIX either... The following does work (at least on UNIX, which of course requires a forward slash):

        filereadable(fnamemodify('~\tags', ':p'))

Actually, filereadable('C:\Documents and Settings\Username\tags')
returns true, and i thought i would do the workaround with this, but i
wouldn't, because when i typing ":set tags=C:\Documents\ and\
Settings\Username\tags", Vim, as a smartass, automatically converts it
into "~\tags", and tags aren't readable for editor.

So, there's no way to put tags file in home directory at Windows.

AFAIK when you execute ":set tags" it will always summarize the user's profile directory (%USERPROFILE% or $HOME) as ~. However I think I found a related bug recently. I had to add two convoluted workarounds for the bug to my easytags Vim plug-in:

 * http://github.com/xolox/vim-easytags/commit/4fef0c1774
 * http://github.com/xolox/vim-easytags/commit/3b934f6e0d
 * http://github.com/xolox/vim-easytags/blob/master/easytags.vim#L122

To summarize, both of the following commands:

        :let &tags = '...'
        :set tags=...

Have weird and undocumented limitations on both UNIX and Windows: Added tags files don't show up in the output of tagsfiles() and are ignored by Vim when the 'tags' option is changed by a Vim plug-in automatically.

 - Peter Odding

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui