Quote:
Originally Posted by Ken Maltby
Wondering why not change the earlier "show_hidden = false" to true?
|
Because I searched for self.show_hidden, so it didn't catch that occurrence.
I'm guessing that your observation is valid and is a better solution than mine. It's just a guess because I don't know much about Lua and I'm using my knowledge of other programming languages here. On the other hand, I only received two results (both in filechooser.lua) when I searched the entire directory tree for "show_hidden". I don't see how changing it in the constructor will be overridden by anything else.
Quote:
Thanks, I'll give it a try. It looks to be not only addressing the .file issue but actual hidden file display as well.
|
On most of the Unix systems I've dealt with, there isn't a hidden file attribute. The software uses the convention that any file starting with a dot is hidden. (This isn't true of OS X so there are exceptions. Then again, the traditional Unix utilities ignore the hidden attribute.)
Actually, the following line alludes to that:
Code:
if self.show_hidden or not string.match(f, "^%.[^.]") then
If the variable show_hidden is true, the condition is always true, so it ignores everything after the "or". However, if the variable is false it tries to match the regular expression. The regular expression matches any filename that starts with exactly one dot and is followed by a non-dot character (more characters can follow, but the regex doesn't care). If it matches the file is hidden so it won't show it. If it doesn't match, it isn't a hidden file so it will show it.