feat: support dot in jump-to-char.yazi
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
local AVAILABLE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
local AVAILABLE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789."
|
||||||
|
|
||||||
local changed = ya.sync(function(st, new)
|
local changed = ya.sync(function(st, new)
|
||||||
local b = st.last ~= new
|
local b = st.last ~= new
|
||||||
st.last = new
|
st.last = new
|
||||||
return b
|
return b or not cx.active.finder
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
local escape = function(s) return s == "." and "\\." or s end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
entry = function()
|
entry = function()
|
||||||
local cands = {}
|
local cands = {}
|
||||||
@@ -18,8 +20,9 @@ return {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if changed(cands[idx].on) then
|
local kw = escape(cands[idx].on)
|
||||||
ya.manager_emit("find_do", { "^" .. cands[idx].on })
|
if changed(kw) then
|
||||||
|
ya.manager_emit("find_do", { "^" .. kw })
|
||||||
else
|
else
|
||||||
ya.manager_emit("find_arrow", {})
|
ya.manager_emit("find_arrow", {})
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user