Fix s/S bindings

This commit is contained in:
2026-04-20 10:42:45 +02:00
parent 94fdf938ee
commit 51fd3f5a4b
2 changed files with 9 additions and 5 deletions
+5 -3
View File
@@ -192,7 +192,7 @@ Snacks.picker.jj_show = function(ref)
item.cwd = cwd
item.status = status
item.file = file
local base, prev, next, suffix = file:match("^(.*){(.+) => (.+)}(.*)$")
local base, prev, next, suffix = file:match("^(.*){(.*) => (.*)}(.*)$")
if base ~= nil then
item.rename = base .. prev .. suffix
item.file = base .. next .. suffix
@@ -263,11 +263,13 @@ Snacks.picker.jj_show = function(ref)
end,
jj_gsplit = function(picker, item)
picker:close()
vim.cmd('Gvsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. item.file))
local commit = vim.trim(vim.fn.system({ "jj", "show", ref, "--template", "commit_id", "--no-patch" }))
vim.cmd('Gvsplit ' .. vim.fn.fnameescape(commit .. ':' .. item.file))
end,
jj_gvsplit = function(picker, item)
picker:close()
vim.cmd('Gsplit ' .. vim.fn.fnameescape(item.commit .. ':' .. item.file))
local commit = vim.trim(vim.fn.system({ "jj", "show", ref, "--template", "commit_id", "--no-patch" }))
vim.cmd('Gsplit ' .. vim.fn.fnameescape(commit .. ':' .. item.file))
end,
},
})
+4 -2
View File
@@ -1,5 +1,7 @@
vim.keymap.set({ 'n', 'x', 'o' }, 's', '<Plug>(leap)')
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)')
vim.keymap.set({ "n", "x" }, "s", "<Plug>(leap-forward-till)", { desc = "Leap forward to" })
vim.keymap.set({ "n", "x" }, "S", "<Plug>(leap-backward)", { desc = "Leap backward to" })
vim.keymap.set("o", "z", "<Plug>(leap-forward-till)", { desc = "Leap forward to" })
vim.keymap.set("o", "Z", "<Plug>(leap-backward)", { desc = "Leap backward to" })
local function ft(key_specific_args)
require('leap').leap(