Skip to content

Commit

Permalink
Fix parsing lines
Browse files Browse the repository at this point in the history
  • Loading branch information
rbong committed Sep 18, 2024
1 parent 954bd5c commit ab1541e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lua/flog/graph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,23 @@ function M.get_graph(
-- Read output until EOF or start token
local out = {}
local nlines = 0
for line in handle:lines() do
if strip_cr then
if strip_cr then
for line in handle:lines() do
nlines = nlines + 1
line = line:gsub('\r$', '')
if line == start_token then
break
end
out[nlines] = line
end
nlines = nlines + 1
if line == start_token then
break
else
for line in handle:lines() do
nlines = nlines + 1
if line == start_token then
break
end
out[nlines] = line
end
out[nlines] = line
end

-- Save commit
Expand Down

0 comments on commit ab1541e

Please sign in to comment.