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

openning files with '(' and ')' in the path - bug?

Expand Messages
  • Denis Perelyubskiy
    Hello, I don t remember seeing this issue brought up, but then I don t read the list often, so maybe I just missed it. I am on windows. I saw this problem in
    Message 1 of 4 , Jan 31, 2004
    • 0 Attachment
      Hello,

      I don't remember seeing this issue brought up, but then I don't read
      the list often, so maybe I just missed it.

      I am on windows. I saw this problem in earlier versions, as well
      as the current 6.2-214 version.

      I have a file at the following location: C:\temp\(folder 1)\(folder
      2)\myfile.txt

      When I drag/drop this file, all is well.

      When I double-click the file, the file is not loaded, and the string
      under the ruler reads: "C:/temp(folder 1)(folder 2)/myfile.h" [New File]
      "

      Notice how the '\' before (folder 1) and '\' before (folder 2) are gone.

      Also, I can't change anything in autocommands, since by that time the
      slashes are already lost.

      This does not seem to be correct. Could you please let me know if you
      think this is a bug, or you think I am doing something wrong?

      thanks,

      -d
      --
      // mailto: Denis Perelyubskiy <lists at overwhelmTAKECAPITALSOUT dot net>
      // icq : 12359698
    • Bram Moolenaar
      ... The problem is that ( and ) are not in isfname . This makes it possible to use a filename in parenthesis and still use gf on it. A workaround is to use
      Message 2 of 4 , Feb 1, 2004
      • 0 Attachment
        Denis Perelyubskiy wrote:

        > I don't remember seeing this issue brought up, but then I don't read
        > the list often, so maybe I just missed it.
        >
        > I am on windows. I saw this problem in earlier versions, as well
        > as the current 6.2-214 version.
        >
        > I have a file at the following location: C:\temp\(folder 1)\(folder
        > 2)\myfile.txt
        >
        > When I drag/drop this file, all is well.
        >
        > When I double-click the file, the file is not loaded, and the string
        > under the ruler reads: "C:/temp(folder 1)(folder 2)/myfile.h" [New File]
        > "
        >
        > Notice how the '\' before (folder 1) and '\' before (folder 2) are gone.
        >
        > Also, I can't change anything in autocommands, since by that time the
        > slashes are already lost.
        >
        > This does not seem to be correct. Could you please let me know if you
        > think this is a bug, or you think I am doing something wrong?

        The problem is that ( and ) are not in 'isfname'. This makes it
        possible to use a filename in parenthesis and still use "gf" on it.

        A workaround is to use "--literal" in the shortcut:

        vim --literal "%1"


        I'm not sure how to make it work automatically. Perhaps expanding
        filenames on the command line should be done with ( and ) included in
        'isfname'?

        --
        hundred-and-one symptoms of being an internet addict:
        3. Your bookmark takes 15 minutes to scroll from top to bottom.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
      • Denis Perelyubskiy
        Bram, On Sun, 01 Feb 2004 16:20:46 +0100, Bram Moolenaar ... Thanks for a quick reply. If I correctly understood it, one should be able
        Message 3 of 4 , Feb 1, 2004
        • 0 Attachment
          Bram,

          On Sun, 01 Feb 2004 16:20:46 +0100, "Bram Moolenaar" <Bram@...>
          said:
          >
          > Denis Perelyubskiy wrote:
          > > [snip]
          > > I am on windows. I saw this problem in earlier versions,
          > > as well as the current 6.2-214 version.
          > >
          > > I have a file at the following location: C:\temp\(folder
          > > 1)\(folder 2)\myfile.txt
          > >
          > > When I drag/drop this file, all is well.
          > >
          > > When I double-click the file, the file is not loaded,
          > > and the string under the ruler reads: "C:/temp(folder
          > > 1)(folder 2)/myfile.h" [New File] "
          > >
          > > Notice how the '\' before (folder 1) and '\' before
          > > (folder 2) are gone.
          > > [snip]
          >
          > The problem is that ( and ) are not in 'isfname'. This
          > makes it possible to use a filename in parenthesis and
          > still use "gf" on it.
          >
          > A workaround is to use "--literal" in the shortcut:
          >
          > vim --literal "%1"
          >
          > I'm not sure how to make it work automatically. Perhaps
          > expanding filenames on the command line should be done
          > with ( and ) included in 'isfname'?

          Thanks for a quick reply. If I correctly understood it, one
          should be able to add '(' and ')' to the isfname and get
          the functionality I am looking for.

          I tried doing the following in my _vimrc: set isfname+=(,)
          (and verified that isfname contains the desired characters
          after startup). However, I am still seeing this behavior.
          I guess if this does not work I could play with gvim.bat,
          but that seems to be a bit clunky.

          Thanks,

          denis
          --
          // mailto: Denis Perelyubskiy <lists at overwhelmTAKECAPITALSOUT dot net>
          // icq : 12359698
        • Bram Moolenaar
          ... The problem is that file name expansion is done before reading the vimrc file. Thus changing isfname in your vimrc file has no effect for expanding the
          Message 4 of 4 , Feb 2, 2004
          • 0 Attachment
            Denis Perelyubskiy wrote:

            > > > I have a file at the following location: C:\temp\(folder
            > > > 1)\(folder 2)\myfile.txt
            > > >
            > > > When I double-click the file, the file is not loaded,
            > > > and the string under the ruler reads: "C:/temp(folder
            > > > 1)(folder 2)/myfile.h" [New File] "
            > > > [snip]
            > >
            > > The problem is that ( and ) are not in 'isfname'. This
            > > makes it possible to use a filename in parenthesis and
            > > still use "gf" on it.
            > >
            > > A workaround is to use "--literal" in the shortcut:
            > >
            > > vim --literal "%1"
            > >
            > > I'm not sure how to make it work automatically. Perhaps
            > > expanding filenames on the command line should be done
            > > with ( and ) included in 'isfname'?
            >
            > Thanks for a quick reply. If I correctly understood it, one
            > should be able to add '(' and ')' to the isfname and get
            > the functionality I am looking for.
            >
            > I tried doing the following in my _vimrc: set isfname+=(,)
            > (and verified that isfname contains the desired characters
            > after startup). However, I am still seeing this behavior.
            > I guess if this does not work I could play with gvim.bat,
            > but that seems to be a bit clunky.

            The problem is that file name expansion is done before reading the vimrc
            file. Thus changing 'isfname' in your vimrc file has no effect for
            expanding the file names on the command line. It does work if you edit
            a file later.

            --
            Shift happens.
            -- Doppler

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
            \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
          Your message has been successfully submitted and would be delivered to recipients shortly.