[PR #294] [MERGED] Implements a buffer limit for the Text widget #310

Closed
opened 2026-03-03 16:23:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mum4k/termdash/pull/294
Author: @timbutler
Created: 2/15/2021
Status: Merged
Merged: 4/3/2021
Merged by: @mum4k

Base: bufferlimitHead: bufferlimit


📝 Commits (5)

  • 057d30f Added a maxContent length for the text widget
  • 239035a Fixed the tests
  • 1798313 Corrected some of the logic
  • 1f646d4 Increase verbosity of the comments
  • 453470b Updated tests

📊 Changes

3 files changed (+143 additions, -0 deletions)

View changed files

📝 widgets/text/options.go (+17 -0)
📝 widgets/text/text.go (+20 -0)
📝 widgets/text/text_test.go (+106 -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 maxContent option.

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.

## 📋 Pull Request Information **Original PR:** https://github.com/mum4k/termdash/pull/294 **Author:** [@timbutler](https://github.com/timbutler) **Created:** 2/15/2021 **Status:** ✅ Merged **Merged:** 4/3/2021 **Merged by:** [@mum4k](https://github.com/mum4k) **Base:** `bufferlimit` ← **Head:** `bufferlimit` --- ### 📝 Commits (5) - [`057d30f`](https://github.com/mum4k/termdash/commit/057d30fc846d507b08741926c997e28ba9503ac6) Added a maxContent length for the text widget - [`239035a`](https://github.com/mum4k/termdash/commit/239035a8884bf120e5adcf6699cdf3751d9d18f8) Fixed the tests - [`1798313`](https://github.com/mum4k/termdash/commit/17983138436445c6450fd40327d44166db39aa0f) Corrected some of the logic - [`1f646d4`](https://github.com/mum4k/termdash/commit/1f646d464663aae9ea95d85000343ab3bd33450e) Increase verbosity of the comments - [`453470b`](https://github.com/mum4k/termdash/commit/453470b97e92afdcda15430de32900bd802ed062) Updated tests ### 📊 Changes **3 files changed** (+143 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `widgets/text/options.go` (+17 -0) 📝 `widgets/text/text.go` (+20 -0) 📝 `widgets/text/text_test.go` (+106 -0) </details> ### 📄 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 `maxContent` option. 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:23:50 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#310
No description provided.