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

Arg. list processing bug

Expand Messages
  • Neil Bird
    I ve convinced myself that this is a bug. Try this (UNIX): # echo one test1 # echo two test2 # ln -s test2 test # ls test1 test2 test@ # vim test* 3
    Message 1 of 3 , Apr 12, 2000
      I've convinced myself that this is a bug. Try this (UNIX):

      # echo one > test1
      # echo two > test2
      # ln -s test2 test
      # ls
      test1 test2 test@
      # vim test*
      3 files to edit
      :ls
      1 % "test" line 1
      2 - "test1" line 0
      Press RETURN or enter command to continue

      So, erm, where's test2?


      At a guess, vim has somehow deduced that test and test2 are the 'same'
      file, but has oddly plumped for the symlink, not the real one. Or is it
      just going for the first one it came across?

      (if you :n from "test", you get "test1", then "test" again [not test2],
      then the no-more error). A :bd on "test" first fixes it)


      I'm not sure about this now. It's certainly not what I'd expect (esp.
      when I really wanted to edit test1 & test2, skipping test, but test* was
      easier to type!).

      --
      =====================- http://www.racaldefence.com/ -===================
      Neil Bird |
      | This .signature is
      mailto:neil.bird@... | certified Y2K compliant
    • Stephen P. Wall
      ... So type test? instead.... =-) -- Free High Speed DSL Access: http://in.winfire.com/s/isapiEng.dll/wf.exe?cmd=rl&452,180045277&wf.exe
      Message 2 of 3 , Apr 12, 2000
        > From: Neil Bird <neil.bird@...>
        >
        > I'm not sure about this now. It's certainly not what I'd expect (esp.
        > when I really wanted to edit test1 & test2, skipping test, but test* was
        > easier to type!).

        So type 'test?' instead.... =-)

        --
        Free High Speed DSL Access:
        http://in.winfire.com/s/isapiEng.dll/wf.exe?cmd=rl&452,180045277&wf.exe
        ______________________________________________________________________
        ________ ______
        Stephen P. Wall Redcom Laboratories, Inc. / __ /\/ ___/\
        Steve_Wall@... One Redcom Center ___/ /\/ /_/ /\__\/
        (716) 924-7550 Victor, NY 14564 /_____/ /_______/ /
        x300 USA \_____\/\_______\/
      • Bram Moolenaar
        ... Do :args , it s there. ... The first one that s found. All the names in the argument list are added to the buffer list. But a file can only be in the
        Message 3 of 3 , Apr 12, 2000
          Neil Bird wrote:

          > I've convinced myself that this is a bug. Try this (UNIX):
          >
          > # echo one > test1
          > # echo two > test2
          > # ln -s test2 test
          > # ls
          > test1 test2 test@
          > # vim test*
          > 3 files to edit
          > :ls
          > 1 % "test" line 1
          > 2 - "test1" line 0
          > Press RETURN or enter command to continue
          >
          > So, erm, where's test2?

          Do ":args", it's there.

          > At a guess, vim has somehow deduced that test and test2 are the 'same'
          > file, but has oddly plumped for the symlink, not the real one. Or is it
          > just going for the first one it came across?

          The first one that's found. All the names in the argument list are added to
          the buffer list. But a file can only be in the buffer list once. The check
          is done on device and inode number, thus symlinks are catched.

          > (if you :n from "test", you get "test1", then "test" again [not test2],
          > then the no-more error). A :bd on "test" first fixes it)

          The ":next" command goes through the argument list. Since "test2" is really
          the same as "test", that's the buffer you will use.

          > I'm not sure about this now. It's certainly not what I'd expect (esp.
          > when I really wanted to edit test1 & test2, skipping test, but test* was
          > easier to type!).

          The shell expands "test*" to "test test1 test2", so that's the arguments you
          get inside Vim. It just does what you told it to do...

          What could be changed is using the name of the actual file, not the first name
          that was found. In this situation that would work. But when you do an ":e
          test2" after ":e test", the name of the buffer would be changed. I'm not sure
          if that doesn't have annoying side effects.

          --
          hundred-and-one symptoms of being an internet addict:
          6. You refuse to go to a vacation spot with no electricity and no phone lines.

          /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
          \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
        Your message has been successfully submitted and would be delivered to recipients shortly.