provide regexpr_dynamic_vim/tmux options, support neovide pstree detection

This commit is contained in:
BZ 2023-09-24 20:15:02 +02:00
parent 4f63582e46
commit de36b7cb00
1 changed files with 6 additions and 2 deletions

View File

@ -115,6 +115,9 @@ local function new(args)
local dont_restore_mods = cfg.dont_restore_mods local dont_restore_mods = cfg.dont_restore_mods
local debug = cfg.debug local debug = cfg.debug
local regexpr_dynamic_vim = "%- N?VIM$"
local regexpr_dynamic_tmux = "%- TMUX$"
local mods = mod_keysym and { mod_keysym } or generate_conversion_map() local mods = mod_keysym and { mod_keysym } or generate_conversion_map()
local wm_keys = { local wm_keys = {
@ -199,14 +202,14 @@ local function new(args)
local c = client.focus local c = client.focus
local client_name = c and c.name or "" local client_name = c and c.name or ""
if string.find(client_name, "%- N?VIM$") then if string.find(client_name, regexpr_dynamic_vim) then
local seq = get_key_sequence(wm_keys.mods, vim_keys.mods, navigate_vim, dir) local seq = get_key_sequence(wm_keys.mods, vim_keys.mods, navigate_vim, dir)
run_fn(seq) run_fn(seq)
if debug then if debug then
debug(string.format("VIM(%s): %s", dir, dump_sequence(seq))) debug(string.format("VIM(%s): %s", dir, dump_sequence(seq)))
end end
return return
elseif string.find(client_name, "%- TMUX$") then elseif string.find(client_name, regexpr_dynamic_tmux) then
local seq = get_key_sequence(wm_keys.mods, tmux_keys.mods, navigate_tmux, dir) local seq = get_key_sequence(wm_keys.mods, tmux_keys.mods, navigate_tmux, dir)
run_fn(seq) run_fn(seq)
if debug then if debug then
@ -234,6 +237,7 @@ local function new(args)
elseif elseif
string.find(out, "[^.*\n]%-n?vim$") string.find(out, "[^.*\n]%-n?vim$")
or string.find(out, "[^.*\n]%-n?vim%-") or string.find(out, "[^.*\n]%-n?vim%-")
or string.find(out, "^neovide%-%-%-nvim")
or string.find(out, "^gvim$") or string.find(out, "^gvim$")
or string.find(out, "^gvim%-") or string.find(out, "^gvim%-")
then then