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

Vim 6.0z - filename completion includes hidden files

Expand Messages
  • Moore, Paul
    Hi, On Windows 2000, vim 6.0z includes hidden files when doing command line filename completion. Is this new? I don t recall it happening previously. If it is
    Message 1 of 7 , Mar 30, 2001
      Hi,
      On Windows 2000, vim 6.0z includes hidden files when doing command line
      filename completion. Is this new? I don't recall it happening previously. If
      it is new, can it be turned off (I find it very annoying)?

      Thanks,
      Paul.
    • Matt Dunford
      ... Is :h suffixes what you re looking for? -- Computer games don t affect kids... I mean, if pac-man affected us as kids, we d all be running around in
      Message 2 of 7 , Mar 30, 2001
        * Moore, Paul <Paul.Moore@...-it.com> [010330 05:22]:
        > Hi,
        > On Windows 2000, vim 6.0z includes hidden files when doing command line
        > filename completion. Is this new? I don't recall it happening previously. If
        > it is new, can it be turned off (I find it very annoying)?

        Is ':h suffixes' what you're looking for?

        --
        Computer games don't affect kids...
        I mean, if pac-man affected us as kids,
        we'd all be running around in darkened rooms,
        munching pills and listening to repetitive music.
        --
      • Vince Negri
        ... If ... It s not new (happened in 5.7 also) and is not unique to Win2K (happens on NT4 also.) In a nutshell, FindFirstFile returns hidden files - and it has
        Message 3 of 7 , Mar 30, 2001
          > On Windows 2000, vim 6.0z includes hidden files when doing command line
          > filename completion. Is this new? I don't recall it happening previously.
          If
          > it is new, can it be turned off (I find it very annoying)?

          It's not new (happened in 5.7 also) and is not unique to Win2K
          (happens on NT4 also.)

          In a nutshell, FindFirstFile returns hidden files - and it has
          no flag to tell it "don't include hidden files". Nor, surprisingly,
          has FindFirstFileEx (though this function isn't available on
          Win9x anyway.)

          What you need to do is scoot over to win32_expandpath() in os_win32.c
          and look for this code:

          else if (mch_getperm(buf) >= 0) /* add existing file */
          {
          /* no more wildcards, check if there is a match */
          /* remove backslashes for the remaining components only */
          if (*path)
          backslash_halve(buf + len + 1);
          if (mch_getperm(buf) >= 0) /* add existing file */
          addfile(gap, buf, flags);
          }

          you need to add an optional check that mch_getperm(buf)
          does not return FILE_ATTRIBUTE_HIDDEN.


          --
          Vince Negri (vnegri@...)
          Application Solutions Ltd. Tel:+44(0)1273-476608 Fax:+44(0)1273-478888

          Legal Disclaimer: Any views expressed by the sender of this message are
          not necessarily those of Application Solutions Ltd. Information in this
          e-mail may be confidential and is for the use of the intended recipient
          only, no mistake in transmission is intended to waive or compromise such
          privilege. Please advise the sender if you receive this e-mail by mistake.
        • vipin aravind
          hello, No friend, you can check for FILE_ATTRIBUTE_HIDDEN(dwFileAttributes member), a file attribute in theWIN32_FIND_DATA structure filled by
          Message 4 of 7 , Mar 30, 2001
            hello,
            No friend, you can check for
            FILE_ATTRIBUTE_HIDDEN(dwFileAttributes member), a file attribute in
            theWIN32_FIND_DATA structure
            filled by FindFirstFile(....) function

            vipin

            > > On Windows 2000, vim 6.0z includes hidden files when doing command line
            > > filename completion. Is this new? I don't recall it happening
            previously.
            > If
            > > it is new, can it be turned off (I find it very annoying)?
            >
            > It's not new (happened in 5.7 also) and is not unique to Win2K
            > (happens on NT4 also.)
            >
            > In a nutshell, FindFirstFile returns hidden files - and it has
            > no flag to tell it "don't include hidden files". Nor, surprisingly,
            > has FindFirstFileEx (though this function isn't available on
            > Win9x anyway.)
            >
            > What you need to do is scoot over to win32_expandpath() in os_win32.c
            > and look for this code:
            >
            > else if (mch_getperm(buf) >= 0) /* add existing file */
            > {
            > /* no more wildcards, check if there is a match */
            > /* remove backslashes for the remaining components only */
            > if (*path)
            > backslash_halve(buf + len + 1);
            > if (mch_getperm(buf) >= 0) /* add existing file */
            > addfile(gap, buf, flags);
            > }
            >
            > you need to add an optional check that mch_getperm(buf)
            > does not return FILE_ATTRIBUTE_HIDDEN.
            >
            >
            > --
            > Vince Negri (vnegri@...)
            > Application Solutions Ltd. Tel:+44(0)1273-476608 Fax:+44(0)1273-478888
            >
            > Legal Disclaimer: Any views expressed by the sender of this message are
            > not necessarily those of Application Solutions Ltd. Information in this
            > e-mail may be confidential and is for the use of the intended recipient
            > only, no mistake in transmission is intended to waive or compromise such
            > privilege. Please advise the sender if you receive this e-mail by mistake.
            >
          • Craig Barkhouse
            Good work guys. I think this is desirable behaviour, and should be added. I would have expected it to ignore hidden files. ... From: vipin aravind
            Message 5 of 7 , Mar 31, 2001
              Good work guys. I think this is desirable behaviour, and should be added.
              I would have expected it to ignore hidden files.


              ----- Original Message -----
              From: "vipin aravind" <vipin.aravind@...>
              To: "Vince Negri" <vnegri@...>; "'Moore Paul'"
              <Paul.Moore@...-it.com>; "Vim Developers (E-mail)" <vim-dev@...>
              Sent: Friday, March 30, 2001 7:19 AM
              Subject: Re: Vim 6.0z - filename completion includes hidden files


              > hello,
              > No friend, you can check for
              > FILE_ATTRIBUTE_HIDDEN(dwFileAttributes member), a file attribute in
              > theWIN32_FIND_DATA structure
              > filled by FindFirstFile(....) function
              >
              > vipin
              >
              > > > On Windows 2000, vim 6.0z includes hidden files when doing command
              line
              > > > filename completion. Is this new? I don't recall it happening
              > previously.
              > > If
              > > > it is new, can it be turned off (I find it very annoying)?
              > >
              > > It's not new (happened in 5.7 also) and is not unique to Win2K
              > > (happens on NT4 also.)
              > >
              > > In a nutshell, FindFirstFile returns hidden files - and it has
              > > no flag to tell it "don't include hidden files". Nor, surprisingly,
              > > has FindFirstFileEx (though this function isn't available on
              > > Win9x anyway.)
              > >
              > > What you need to do is scoot over to win32_expandpath() in os_win32.c
              > > and look for this code:
              > >
              > > else if (mch_getperm(buf) >= 0) /* add existing file */
              > > {
              > > /* no more wildcards, check if there is a match */
              > > /* remove backslashes for the remaining components only */
              > > if (*path)
              > > backslash_halve(buf + len + 1);
              > > if (mch_getperm(buf) >= 0) /* add existing file */
              > > addfile(gap, buf, flags);
              > > }
              > >
              > > you need to add an optional check that mch_getperm(buf)
              > > does not return FILE_ATTRIBUTE_HIDDEN.
            • Bram Moolenaar
              ... I often want to edit a hidden file. msdos.sys for example. The logic to decide which files to make hidden is unclear to me. I prefer to ignore the
              Message 6 of 7 , Apr 1, 2001
                Craig Barkhouse wrote:

                > Good work guys. I think this is desirable behaviour, and should be added.
                > I would have expected it to ignore hidden files.

                I often want to edit a hidden file. msdos.sys for example. The logic to
                decide which files to make hidden is unclear to me. I prefer to ignore the
                hidden flag when looking around for files to edit.

                Some people might prefer to ignore hidden files, but it would require
                yet-another-option. You might also want to ignore *.exe files, it's unlikely
                you want to edit these. But they don't have the hidden flag. Thus the option
                gets more complicated. You are probably better off using 'wildignore'.

                --
                BEDEVERE: Why do you think she is a witch?
                SECOND VILLAGER: She turned me into a newt.
                BEDEVERE: A newt?
                SECOND VILLAGER: (After looking at himself for some time) I got better.
                "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
              • Craig Barkhouse
                ... the ... unlikely ... option ... Maybe we can work the option into wildignore somehow. How about if the pattern starts with two consecutive asterisks, it
                Message 7 of 7 , Apr 1, 2001
                  Bram wrote:
                  > I often want to edit a hidden file. msdos.sys for example. The logic to
                  > decide which files to make hidden is unclear to me. I prefer to ignore
                  the
                  > hidden flag when looking around for files to edit.
                  >
                  > Some people might prefer to ignore hidden files, but it would require
                  > yet-another-option. You might also want to ignore *.exe files, it's
                  unlikely
                  > you want to edit these. But they don't have the hidden flag. Thus the
                  option
                  > gets more complicated. You are probably better off using 'wildignore'.

                  Maybe we can work the option into 'wildignore' somehow. How about if the
                  pattern starts with two consecutive asterisks, it is really a meta-pattern
                  matching files with a certain characteristic? So if you put the pattern
                  "**hidden" into your 'wildignore' string, wildcard expansion would ignore
                  hidden files. I can think of lots of other characteristics we could add as
                  needed/desired.
                Your message has been successfully submitted and would be delivered to recipients shortly.