File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 1- local Job = require (" plenary.job" )
2-
31local Ui = require (" neogit.lib.ui" )
42local Component = require (" neogit.lib.ui.component" )
53local util = require (" neogit.lib.util" )
@@ -35,17 +33,13 @@ M.DiffHunks = Component.new(function(diff)
3533 local content = vim .list_slice (diff .lines , hunk .diff_from + 1 , hunk .diff_to )
3634 local job = nil
3735 if config .values .log_pager ~= nil then
38- job = Job :new {
39- command = config .values .log_pager [1 ],
40- args = vim .list_slice (config .values .log_pager , 2 ),
41- }
42- job :start ()
36+ job = vim .system (config .values .log_pager , { stdin = true })
4337 for _ , part in ipairs { diff .header , { header }, content } do
4438 for _ , line in ipairs (part ) do
45- job :send (line .. " \n " )
39+ job :write (line .. " \n " )
4640 end
4741 end
48- job . stdin : close ()
42+ job : write ()
4943 end
5044
5145 return {
@@ -60,8 +54,7 @@ M.DiffHunks = Component.new(function(diff)
6054
6155 if config .values .log_pager ~= nil then
6256 vim .iter (hunk_props ):each (function (hunk )
63- hunk .job :wait ()
64- hunk .content = hunk .job :result ()
57+ hunk .content = vim .split (hunk .job :wait ().stdout , " \n " )
6558 hunk .job = nil
6659 end )
6760 end
You can’t perform that action at this time.
0 commit comments