diff options
author | Grail Finder <wohilas@gmail.com> | 2025-04-05 21:01:48 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-04-05 21:01:48 +0300 |
commit | c6de09562bb1e24ea00acba2c0467940f845b632 (patch) | |
tree | 0baf42a0fd97766f31fbdf334af152bee3bb00de | |
parent | 67e540298a72ecef7d07ac6c25a0282c8f4a68ff (diff) |
Bug: two esc presses needed to exit edit page
-rw-r--r-- | tui.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -294,7 +294,8 @@ func init() { defer func() { editMode = false }() - if event.Key() == tcell.KeyEscape && editMode { + // if event.Key() == tcell.KeyEscape && editMode { + if event.Key() == tcell.KeyEscape { defer colorText() editedMsg := editArea.GetText() if editedMsg == "" { @@ -319,8 +320,8 @@ func init() { SetDoneFunc(func(key tcell.Key) { defer indexPickWindow.SetText("") pages.RemovePage(indexPage) - colorText() - updateStatusLine() + // colorText() + // updateStatusLine() }) indexPickWindow.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { switch event.Key() { @@ -349,6 +350,7 @@ func init() { } m := chatBody.Messages[selectedIndex] if editMode && event.Key() == tcell.KeyEnter { + pages.RemovePage(indexPage) pages.AddPage(editMsgPage, editArea, true, true) editArea.SetText(m.Content, true) } |