mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-27 03:15:55 +03:00
[PR #301] [MERGED] Implements a buffer limit for the Text widget. #317
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mum4k/termdash/pull/301
Author: @mum4k
Created: 4/3/2021
Status: ✅ Merged
Merged: 4/3/2021
Merged by: @mum4k
Base:
devel← Head:bufferlimit📝 Commits (10+)
7225045Implements a buffer limit for the Text widget (#294)ae4be21Merge branch 'devel' into bufferlimit3faca08Renaming the option to MaxTextCells.3a86253Noting MaxTextCells in the CHANGELOG.e1c872dRefactor text truncation.0f1a339Correctly handle wide runes.18e27ecCorrectly handle newline characters.6a2d2bbCorrectly account for pre-existing full-width runes in the content.4ef1db1Runewidth allows overrides.750270fRemove custom runewidth and stringwidth helpers.📊 Changes
6 files changed (+396 additions, -7 deletions)
View changed files
📝
CHANGELOG.md(+5 -0)📝
private/runewidth/runewidth.go(+47 -3)📝
private/runewidth/runewidth_test.go(+22 -3)📝
widgets/text/options.go(+25 -0)📝
widgets/text/text.go(+48 -1)📝
widgets/text/text_test.go(+249 -0)📄 Description
See issue #293 where memory and performance can degrade with a high number of lines written to the Text widget.
This is a very simplistic implementation to limit the possible length the text buffer can grow to with the
maxContentoption.Default value of -1 means there's no limit and therefore behaviour should remain standard.
It has been working in our test app and allows the use of the Text widget to monitor logs (ie tail) and therefore doesn't bloat over time, but happy to adjust as required.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.