Loading ...
Sorry, an error occurred while loading the content.

Re: Explorer.vim and directories with ]['"s

Expand Messages
  • Bram Moolenaar
    ... Thanks! ... Swap Unix and Mac . ... This is complicated stuff. It depends on how the globbing is done. I ll make a note in the todo list, but feel free
    Message 1 of 2 , Feb 26, 2003
    • 0 Attachment
      Nazri Ramliy wrote:

      > On unix, using explorer.vim to browse to a directory which name
      > contains characters inside matching square brackets (like "foo[bar]")
      > doesn't work.
      >
      > The patch below fixes this. It also handles directory names that
      > contain double quotes (").

      Thanks!

      > I tried to make it handle single quotes as
      > well by adding a single quote to s:escfilename like such:
      >
      > let s:escfilename=s:escfilename . "'"
      >
      > but this doesn't work (that is, changing to a directory which name
      > that contain a single quote, using the explorer).
      >
      > Investigating this further, it seems to me that glob() doesn't like
      > directories with ' in its name:
      >
      > glob("d\'/*") returns nothing, even though the directory "d'" do
      > contain a few files. Does this has something to do with the fact that
      > the single quote character is not included in PATH_ESC_CHARS
      > (vim.h:278):
      >
      > #ifdef BACKSLASH_IN_FILENAME
      > # define PATH_ESC_CHARS ((char_u *)" *?[{`%#") // Dos
      > #else
      > # ifdef COLON_AS_PATHSEP
      > # define PATH_ESC_CHARS ((char_u *)" *?[{`$%#/") // Unix
      > # else
      > # define PATH_ESC_CHARS ((char_u *)" *?[{`$\\%#'\"|") // MAC, right?
      > # endif
      > #endif

      Swap "Unix" and "Mac".

      > Why aren't the quote and double quote characters included in all
      > possible variant of PATH_ESC_CHARS?

      This is complicated stuff. It depends on how the globbing is done.
      I'll make a note in the todo list, but feel free to dig into this and
      find the solution!

      --
      User: I'm having problems with my text editor.
      Help desk: Which editor are you using?
      User: I don't know, but it's version VI (pronounced: 6).
      Help desk: Oh, then you should upgrade to version VIM (pronounced: 994).

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.