-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add note about input prompt scaling, and add options to change the key to start and restart searches #10
base: master
Are you sure you want to change the base?
Add note about input prompt scaling, and add options to change the key to start and restart searches #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -60,6 +60,10 @@ local o = { | |||||
--number of pixels to pan on each click | ||||||
--this refers to the horizontal panning | ||||||
pan_speed = 100, | ||||||
|
||||||
--these change the default keybindings to open a search, as well as to restart a search, while a page is open | ||||||
keybind_open_search = "f12", | ||||||
keybind_open_flag_search = "Shift+f12", | ||||||
|
||||||
--all colour options | ||||||
ass_header = "{\\c&H00ccff&\\fs40\\b500\\q2\\fnMonospace}", | ||||||
|
@@ -190,8 +194,8 @@ local function create_page(type, t) | |||||
{"Ctrl+LEFT", "page_left_search", function() temp:move_page(-1, true) end, {}}, | ||||||
{"Ctrl+RIGHT", "page_right_search", function() temp:move_page(1, true) end, {}}, | ||||||
{"Ctrl+ENTER", "run_latest", function() temp:run_search(LATEST_SEARCH.keyword, LATEST_SEARCH.flags) end, {}}, | ||||||
{"f12", "open_search", function() temp:get_input(false) end, {}}, | ||||||
{"Shift+f12", "open_flag_search", function() temp:get_input(true) end, {}} | ||||||
{o.keybind_open_search, "open_search", function() temp:get_input(false) end, {}}, | ||||||
{o.keybind_open_flag_search, "open_flag_search", function() temp:get_input(true) end, {}} | ||||||
Comment on lines
+197
to
+198
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of this PR is actually unnecessary. If we remove these two lines:
Suggested change
And change the function list_meta:open_wrapper(advanced)
if self.keyword == nil then self.empty_text = "Press f12 to enter search query" end
local hidden = self.hidden
if hidden then self:open() end
if self.keyword == nil or not hidden then self:get_input(advanced) end
end Then the standard mpv keybind to open the page will be also be used when the page is open instead of being overridden. Then the keybinds can be changed by using standard |
||||||
} | ||||||
return temp | ||||||
end | ||||||
|
@@ -502,7 +506,7 @@ function list_meta:run_search() | |||||
end | ||||||
|
||||||
function list_meta:open_wrapper(advanced) | ||||||
if self.keyword == nil then self.empty_text = "Press f12 to enter search query" end | ||||||
if self.keyword == nil then self.empty_text = "Enter a new search query" end | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with this change. |
||||||
self:open() | ||||||
if self.keyword == nil then self:get_input(advanced) end | ||||||
end | ||||||
|
@@ -546,11 +550,11 @@ function list_meta:get_input(get_flags) | |||||
coroutine_resume_err(co) | ||||||
end | ||||||
|
||||||
mp.add_key_binding("f12", "open-search-page", function() | ||||||
mp.add_key_binding(o.keybind_open_search, "open-search-page", function() | ||||||
CURRENT_PAGE:open_wrapper() | ||||||
end) | ||||||
|
||||||
mp.add_key_binding("Shift+f12", "open-search-page/advanced", function() | ||||||
mp.add_key_binding(o.keybind_open_flag_search, "open-search-page/advanced", function() | ||||||
CURRENT_PAGE:open_wrapper(true) | ||||||
end) | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of recommending an entry in
mpv.conf
I would instead prefer to recommend an entry in~~/script-opts/user_input.conf
which would containscale=1
.