Gary Johnson wrote:

> While reading the discussion of "Security risk of vim swap files,"
> I decided to review where my swap files were being saved and
> discovered that my 'directory' setting was not being obeyed.
> 
> My 'directory' contains a list of directory names, all ending in
> "//" on Unix.  All the names beginning with "~" were being ignored,
> even though they were writable.  I tried finding a simple case to
> illustrate the problem and discovered that the results depend on
> whether I set 'directory' with :set or :let.
> 
> My home directory contains a tmp directory writable by me.
> 
>     $ cd
>     $ ls -ld tmp
>     drwxr-xr-x 8 gary gary 8192 Nov  6 10:48 tmp
> 
> Case 1:  let
> 
>     $ vim -N -u NONE -i NONE --cmd 'let &directory="~/tmp,/tmp"' foo
>     :set directory?
>       directory=~/tmp,/tmp
>     :swapname
>     /tmp/foo.swp
> 
> Case 2: set
> 
>     $ vim -N -u NONE -i NONE --cmd 'set directory=~/tmp,/tmp' foo
>     :set directory?
>       directory=~/tmp,/tmp
>     :swapname
>     /home/gary/tmp/foo.swp
> 
> I see no difference between the values of 'directory' whether :set
> or :let, yet the tilde is expanded correctly when 'directory' is :set
> and apparently not expanded when 'directory' is :let.
> 
> I'm running Vim 8.0.1257 on a system running Red Hat Linux
> Enterprise Linux 7.2.

Instead of:
        :set directory?
Try this:
        :echo &directory

And you'll see what happens.

-- 
A fool must search for a greater fool to find admiration.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui