From 1d3842ffa054ff699963bb42387c19a06ff22c7a Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Tue, 11 Feb 2020 15:13:20 +0100 Subject: [PATCH] [fix] More accurate count in FileChooser (#5846) Fixes . --- frontend/ui/widget/filechooser.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/ui/widget/filechooser.lua b/frontend/ui/widget/filechooser.lua index fee16d381..ba247d3c1 100644 --- a/frontend/ui/widget/filechooser.lua +++ b/frontend/ui/widget/filechooser.lua @@ -62,7 +62,9 @@ function FileChooser:init() if ok then for f in iter, dir_obj do if count_only then - if self.show_hidden or not util.stringStartsWith(f, ".") then + if (not self.show_hidden and not util.stringStartsWith(f, ".")) + or (self.show_hidden and f ~= "." and f ~= ".." and self.dir_filter(f) and not util.stringStartsWith(f, "._")) + then table.insert(dirs, true) end elseif self.show_hidden or not string.match(f, "^%.[^.]") then