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 b = st.last ~= new
|
||||
st.last = new
|
||||
return b
|
||||
return b or not cx.active.finder
|
||||
end)
|
||||
|
||||
local escape = function(s) return s == "." and "\\." or s end
|
||||
|
||||
return {
|
||||
entry = function()
|
||||
local cands = {}
|
||||
@@ -18,8 +20,9 @@ return {
|
||||
return
|
||||
end
|
||||
|
||||
if changed(cands[idx].on) then
|
||||
ya.manager_emit("find_do", { "^" .. cands[idx].on })
|
||||
local kw = escape(cands[idx].on)
|
||||
if changed(kw) then
|
||||
ya.manager_emit("find_do", { "^" .. kw })
|
||||
else
|
||||
ya.manager_emit("find_arrow", {})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user