Skip to content

Commit 18a3df6

Browse files
opts: extension filters now always use comma separators
The root separator is no-longer used.
1 parent e05a6df commit 18a3df6

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

docs/file_browser.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ filter_files=yes
5959

6060
# file-browser only shows files that are compatible with mpv by default
6161
# adding a file extension to this list will add it to the extension whitelist
62-
# extensions are separated with the root separators, do not use any spaces
62+
# extensions are separated with commas, do not use any spaces
6363
extension_whitelist=
6464

6565
# add file extensions to this list to disable default filetypes

modules/options.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ local o = {
3535
custom_keybinds_file = "~~/script-opts/file-browser-keybinds.json",
3636

3737
--blacklist compatible files, it's recommended to use this rather than to edit the
38-
--compatible list directly. A semicolon separated list of extensions without spaces
38+
--compatible list directly. A comma separated list of extensions without spaces
3939
extension_blacklist = "",
4040

4141
--add extra file extensions

modules/setup.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ local fb = require 'modules.apis.fb'
88
--sets up the compatible extensions list
99
local function setup_extensions_list()
1010
--setting up subtitle extensions
11-
for ext in fb_utils.iterate_opt(o.subtitle_extensions:lower()) do
11+
for ext in fb_utils.iterate_opt(o.subtitle_extensions:lower(), ',') do
1212
g.sub_extensions[ext] = true
1313
g.extensions[ext] = true
1414
end
1515

1616
--setting up audio extensions
17-
for ext in fb_utils.iterate_opt(o.audio_extensions:lower()) do
17+
for ext in fb_utils.iterate_opt(o.audio_extensions:lower(), ',') do
1818
g.audio_extensions[ext] = true
1919
g.extensions[ext] = true
2020
end
@@ -25,12 +25,12 @@ local function setup_extensions_list()
2525
end
2626

2727
--adding extra extensions on the whitelist
28-
for str in fb_utils.iterate_opt(o.extension_whitelist:lower()) do
28+
for str in fb_utils.iterate_opt(o.extension_whitelist:lower(), ',') do
2929
g.extensions[str] = true
3030
end
3131

3232
--removing extensions that are in the blacklist
33-
for str in fb_utils.iterate_opt(o.extension_blacklist:lower()) do
33+
for str in fb_utils.iterate_opt(o.extension_blacklist:lower(), ',') do
3434
g.extensions[str] = nil
3535
end
3636
end

modules/utils.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,10 @@ end
402402

403403
---Returns a string iterator that uses the root separators.
404404
---@param str any
405+
---@param separators? string Override the root separators.
405406
---@return fun():(string, ...)
406-
function fb_utils.iterate_opt(str)
407-
return string.gmatch(str, "([^"..fb_utils.pattern_escape(o.root_separators).."]+)")
407+
function fb_utils.iterate_opt(str, separators)
408+
return string.gmatch(str, "([^"..fb_utils.pattern_escape(separators or o.root_separators).."]+)")
408409
end
409410

410411
---Sorts a table into an array of selected items in the correct order.

0 commit comments

Comments
 (0)