Add default_directory option

resolves #72
This commit is contained in:
tomasklaen
2022-04-30 21:53:21 +02:00
parent b6a90091a2
commit 7a0c648ae7
2 changed files with 6 additions and 1 deletions

View File

@@ -163,6 +163,8 @@ subtitle_types=aqt,gsub,jss,sub,ttxt,pjs,psb,rt,smi,slt,ssf,srt,ssa,ass,usf,idx,
# if you are using some wide font and see a lot of right side clipping in menus,
# try bumping this up
font_height_to_letter_width_ratio=0.5
# default open-file menu directory
default_directory=~/
# `chapter_ranges` lets you transform chapter indicators into range indicators.
#

View File

@@ -129,6 +129,8 @@ subtitle_types=aqt,gsub,jss,sub,ttxt,pjs,psb,rt,smi,slt,ssf,srt,ssa,ass,usf,idx,
# if you are using some wide font and see a lot of right side clipping in menus,
# try bumping this up
font_height_to_letter_width_ratio=0.5
# default open-file menu directory
default_directory=~/
# `chapter_ranges` lets you transform chapter indicators into range indicators.
#
@@ -295,6 +297,7 @@ local options = {
media_types = '3gp,asf,avi,bmp,flac,flv,gif,h264,h265,jpeg,jpg,m4a,m4v,mid,midi,mkv,mov,mp3,mp4,mp4a,mp4v,mpeg,mpg,oga,ogg,ogm,ogv,opus,png,rmvb,svg,tif,tiff,wav,weba,webm,webp,wma,wmv',
subtitle_types = 'aqt,gsub,jss,sub,ttxt,pjs,psb,rt,smi,slt,ssf,srt,ssa,ass,usf,idx,vt',
font_height_to_letter_width_ratio = 0.5,
default_directory = '~/',
chapter_ranges = '^op| op$|opening<968638:0.5>.*, ^ed| ed$|^end|ending$<968638:0.5>.*|{eof}, sponsor start<3535a5:.5>sponsor end, segment start<3535a5:0.5>segment end',
}
opt.read_options(options, 'uosc')
@@ -3457,7 +3460,7 @@ mp.add_key_binding(nil, 'open-file', function()
local active_file
if path == nil or is_protocol(path) then
local path = serialize_path(mp.command_native({'expand-path', '~/'}))
local path = serialize_path(mp.command_native({'expand-path', options.default_directory}))
directory = path.path
active_file = nil
else