reblessed icon indicating copy to clipboard operation
reblessed copied to clipboard

log: fix scrollback line limit

Open anszom opened this issue 1 year ago • 0 comments

There are two issues with the scrollback limit of the Log component.

  1. shiftLine is used incorrectly (two arguments instead of one), so only a single line is removed from the scrollback on each call.
  2. If the caller pushes a huge number of lines on each call, the log can still exceed the scrollback limit.

Issue 1 can be reproduced by any code that repeatedly calls log with a string containing a newline, issue 2 is more theoretical, but this commit fixes both at the same time.

anszom avatar Sep 14 '23 15:09 anszom