@@ -12,10 +12,12 @@ function first_hunk_new_lineno(git_diff)
1212 return nil
1313end
1414
15- function edit_from_details ()
16- local diff = jj (" diff" , " --git" , " -r" , context .change_id (), context .file ())
17- local line_number = first_hunk_new_lineno (diff )
18- exec_shell (string.format (" nvim +%q %q" , line_number , context .file ()))
15+ function edit_from_details (editor )
16+ return function ()
17+ local diff = jj (" diff" , " --git" , " -r" , context .change_id (), context .file ())
18+ local line_number = first_hunk_new_lineno (diff )
19+ exec_shell (string.format (" %q +%q %q" , editor , line_number , context .file ()))
20+ end
1921end
2022
2123function diffpipe (tool )
@@ -83,7 +85,8 @@ function setup(config)
8385 { desc = " delta diff" , key = " d" , scope = " revisions" }
8486 )
8587
86- config .action (" edit file" , edit_from_details , { desc = " edit file" , scope = " revisions.details" , key = " e" })
88+ config .action (" edit file" , edit_from_details (" vim" ), { desc = " edit file" , scope = " revisions.details" , key = " e" })
89+ config .action (" visual file" , edit_from_details (" vim-gui" ), { desc = " visual file" , scope = " revisions.details" , key = " v" })
8790
8891 config .action (
8992 " diff file" ,
0 commit comments