Skip to content

Commit

Permalink
Improve snapshot cropping algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Mar 18, 2024
1 parent 63a17c9 commit 29bfa86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/asciinema/recordings/snapshot.ex
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ defmodule Asciinema.Recordings.Snapshot do
end

defp blank_segment?({text, attrs, _char_width}) do
String.trim(text) == "" && attrs == %{}
String.trim(text) == "" && attrs["bg"] == nil
end

defp fill_to_height(lines, height) do
Expand Down
2 changes: 1 addition & 1 deletion test/asciinema/recordings/snapshot_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ defmodule Asciinema.Recordings.SnapshotTest do
[
[["foobar", %{}, 1]],
[["bazquxquux", %{}, 1]],
[],
[[" ", %{fg: 5}, 1]],
[]
],
5,
Expand Down

0 comments on commit 29bfa86

Please sign in to comment.