Bill McCarthy wrote:
> On Sun 23-Sep-07 8:34pm -0600, Dasn wrote:
>
>> I've posted on vim_use some days before:
>>
>>> $ vim -c "q" 'foo ~ foo'
>>> $ vim -c "normal '0"
>>> E20: Mark not set
>> Filename contains '~' character which is around with path separators
>> (i.e. ' ' and ',') has such problem.
>>
>> And the patch:
>>
>> Index: mark.c
>
> With Windows (using XP) the problem is far nastier. Simply
> opening a file with that name:
>
> gvim "foo ~ foo"
>
> causes problems. Specifically, I receive the following
> message:
>
> E303: Unable to open swap file for "foo C:\Documents and Settings\Bill
> foo", recovery impossible
>
> Notice how the '~' is expanded.
>
> In my environment:
>
> HOMEDRIVE=C:
> HOMEPATH=\Documents and Settings\Bill
>
IIRC, On Windows the tilde is expanded by Vim; but IMHO it ought only to be
expanded when it is the first element of the path, followed by a path
separator or by the end of the string:
~ means $HOME means %HOMEDRIVE%%HOMEPATH if %HOME% isn't set
~/foo means $HOME/foo means %HOME%\foo, or substitute as above
~bill means bill's $HOME on Unix but ".\~bill" on Windows
C:/PROGRA~1 means "C:\PROGRA~1", expanded to "C:\Program Files" by the
filesystem. It is important NOT to replace ~ by $HOME here.
foo\ ~\ bar means ".\foo ~ bar"
Fixing this would (I suppose) patching wherever it is that Vim expands the
tilde on Windows (IIRC, on Unix tilde-expansion is subcontracted to the shell).
Best regards,
Tony.
--
It's not the valleys in life I dread so much as the dips.
-- Garfield
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---