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

Re: Not working wildcards in findfile()

Expand Messages
  • Markus Braun
    ... Oh, I forgot to mention that this happens for me on Linux vim 7.3.547 and 7.3.1220 Markus Braun -- Any errors in spelling, tact or fact are transmission
    Message 1 of 6 , Jun 20, 2013
    • 0 Attachment
      On Thu, Jun 20, 2013 at 08:40:51AM -0700, Ben Fritz (fritzophrenic@...) wrote:
      > I can't see anything wrong with it, you may have found a bug. I verified the same behavior on Windows gvim 7.3.822.

      Oh, I forgot to mention that this happens for me on Linux vim 7.3.547 and
      7.3.1220

      Markus Braun

      --
      Any errors in spelling, tact or fact are transmission errors

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Christian Brabandt
      Hi Markus! ... Looks like a bug. I almost have a working patch. I need to test it some more... Mit freundlichen Grüßen Christian -- Es gibt Dinge, die muß
      Message 2 of 6 , Jun 21, 2013
      • 0 Attachment
        Hi Markus!

        On Do, 20 Jun 2013, Markus Braun wrote:

        > I have a question about using wildcards in the path argument to findfile()
        > function. When running these commands
        >
        > mkdir -p "test/dir-1/" && touch "test/dir-1/foo"
        > mkdir -p "test/dir-2/" && touch "test/dir-2/foo"
        > mkdir -p "test/dir-3/" && touch "test/dir-3/foo"
        > vim -u NONE -c "echo string(findfile('foo', 'test/*', -1))|call input('press ENTER to exit')|q"
        > vim -u NONE -c "echo string(findfile('foo', 'test/dir-*', -1))|call input('press ENTER to exit')|q"
        >
        > I would expect vim to output both times the same output of
        >
        > ['test/dir-1/foo', 'test/dir-2/foo', 'test/dir-3/foo']
        >
        > but the second vim instance only gives
        >
        > []
        >
        > I don't understand this behavior. What am I doing wrong here?

        Looks like a bug. I almost have a working patch. I need to test it some
        more...

        Mit freundlichen Grüßen
        Christian
        --
        Es gibt Dinge, die muß man tun, sonst ist man kein Mensch, sondern nur
        ein Häuflein Dreck.
        -- Astrid Lindgren

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Christian Brabandt
        ... Bram, here is a patch, that makes findfile() behave as expected. Problem is, findfile() currently expects wildcards to be only after a valid directory name
        Message 3 of 6 , Jun 22, 2013
        • 0 Attachment
          On Fr, 21 Jun 2013, Christian Brabandt wrote:
          > On Do, 20 Jun 2013, Markus Braun wrote:
          >
          > > I have a question about using wildcards in the path argument to findfile()
          > > function. When running these commands
          > >
          > > mkdir -p "test/dir-1/" && touch "test/dir-1/foo"
          > > mkdir -p "test/dir-2/" && touch "test/dir-2/foo"
          > > mkdir -p "test/dir-3/" && touch "test/dir-3/foo"
          > > vim -u NONE -c "echo string(findfile('foo', 'test/*', -1))|call input('press ENTER to exit')|q"
          > > vim -u NONE -c "echo string(findfile('foo', 'test/dir-*', -1))|call input('press ENTER to exit')|q"
          > >
          > > I would expect vim to output both times the same output of
          > >
          > > ['test/dir-1/foo', 'test/dir-2/foo', 'test/dir-3/foo']
          > >
          > > but the second vim instance only gives
          > >
          > > []
          > >
          > > I don't understand this behavior. What am I doing wrong here?
          >
          > Looks like a bug. I almost have a working patch. I need to test it some
          > more...

          Bram,
          here is a patch, that makes findfile() behave as expected. Problem is,
          findfile() currently expects wildcards to be only after a valid
          directory name and for cases like findfile('test19.in', 'src/test*') (in
          Vim source directory), it tries to find a file 'test19.in' in a
          directory vim/src/test/ which doesn't exists and therefore fails.

          Patch contains a test.

          regards,
          Christian
          --
          "Sie servieren heute Hasenbraten, las ich draußen", sagte der Beamte der
          Gewerbeaufsicht. "Reiner Hasenbraten?"
          "Mit etwas Pferd", gestand der Gastronom.
          "In welchem Verhältnis?"
          "50 zu 50: Ein Hase, ein Pferd."

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Bram Moolenaar
          ... Thanks! -- Edison s greatest achievement came in 1879, when he invented the electric company. Edison s design was a brilliant adaptation of the simple
          Message 4 of 6 , Jun 22, 2013
          • 0 Attachment
            Christian Brabandt wrote:

            > On Fr, 21 Jun 2013, Christian Brabandt wrote:
            > > On Do, 20 Jun 2013, Markus Braun wrote:
            > >
            > > > I have a question about using wildcards in the path argument to findfile()
            > > > function. When running these commands
            > > >
            > > > mkdir -p "test/dir-1/" && touch "test/dir-1/foo"
            > > > mkdir -p "test/dir-2/" && touch "test/dir-2/foo"
            > > > mkdir -p "test/dir-3/" && touch "test/dir-3/foo"
            > > > vim -u NONE -c "echo string(findfile('foo', 'test/*', -1))|call input('press ENTER to exit')|q"
            > > > vim -u NONE -c "echo string(findfile('foo', 'test/dir-*', -1))|call input('press ENTER to exit')|q"
            > > >
            > > > I would expect vim to output both times the same output of
            > > >
            > > > ['test/dir-1/foo', 'test/dir-2/foo', 'test/dir-3/foo']
            > > >
            > > > but the second vim instance only gives
            > > >
            > > > []
            > > >
            > > > I don't understand this behavior. What am I doing wrong here?
            > >
            > > Looks like a bug. I almost have a working patch. I need to test it some
            > > more...
            >
            > Bram,
            > here is a patch, that makes findfile() behave as expected. Problem is,
            > findfile() currently expects wildcards to be only after a valid
            > directory name and for cases like findfile('test19.in', 'src/test*') (in
            > Vim source directory), it tries to find a file 'test19.in' in a
            > directory vim/src/test/ which doesn't exists and therefore fails.
            >
            > Patch contains a test.

            Thanks!

            --
            Edison's greatest achievement came in 1879, when he invented the
            electric company. Edison's design was a brilliant adaptation of the
            simple electrical circuit: the electric company sends electricity
            through a wire to a customer, then immediately gets the electricity
            back through another wire

            /// Bram Moolenaar -- Bram@... -- 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_use" 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_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          Your message has been successfully submitted and would be delivered to recipients shortly.