[PR #857] [MERGED] Closes #844 Fix TextArea's SetText by resetting nextUndo counter #1064

Closed
opened 2026-03-04 01:09:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/857
Author: @JoseRizzal
Created: 6/10/2023
Status: Merged
Merged: 6/15/2023
Merged by: @rivo

Base: masterHead: textarea__fix_nextUndo_after_SetText


📝 Commits (1)

  • 5f8630c textarea -- fix nextUndo after SetText

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 textarea.go (+1 -0)

📄 Description

TextArea's method SetText() has wrong undo logic. Currently only undoStack has reset, which means, if SetText() called second time, nextUndo counter stays the same. If press Ctrl-Z right after second SetText() it trying to reach nextUndo position into empty undoStack and get panic


🔄 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/rivo/tview/pull/857 **Author:** [@JoseRizzal](https://github.com/JoseRizzal) **Created:** 6/10/2023 **Status:** ✅ Merged **Merged:** 6/15/2023 **Merged by:** [@rivo](https://github.com/rivo) **Base:** `master` ← **Head:** `textarea__fix_nextUndo_after_SetText` --- ### 📝 Commits (1) - [`5f8630c`](https://github.com/rivo/tview/commit/5f8630c515eee5b4e208212cfbeba332f93cba59) textarea -- fix nextUndo after SetText ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `textarea.go` (+1 -0) </details> ### 📄 Description TextArea's method `SetText()` has wrong undo logic. Currently only `undoStack` has reset, which means, if `SetText()` called second time, `nextUndo` counter stays the same. If press `Ctrl-Z` right after second `SetText()` it trying to reach `nextUndo` position into empty `undoStack` and get panic --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:09:16 +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/tview#1064
No description provided.