https://gitlab.synchro.net/main/sbbs/-/commit/bc37406b8b567a4417f36f15
Modified Files:
src/sbbs3/writemsg.cpp
Log Message:
Message editor: keep the screen in sync when moving between lines (#1473)
Up-arrow in the internal message editor moved the cursor up a row without checking that the row showed the line being edited. Above the top of the screen, or after a slash command had printed something, the user edited
a line they couldn't see, over the text of a different one. Inserting or removing a line in the middle redrew every following line and then moved
back up by line count, which scrolled a long message and lost the cursor.
msgeditor() now tracks how many lines directly above the cursor are shown correctly. Moving up beyond those clears the screen and redraws a window
around the target line; drawing the lines below stops at the bottom row.
Moving up or down keeps the cursor's display column rather than its byte offset, so it stays put across UTF-8 and double-width characters, and left-arrow/backspace at column 0 lands at the end of the previous line.
On terminals that can't move the cursor, the up/left/backspace line exits
now keep editing the current line instead of silently changing lines.
Also fixed: edits to the first line were discarded when up-arrow was
pressed on it, and "Only N lines left" was printed (over the screen) when editing a line in the middle of the message.
The arrow-key navigation dates from 3557bc54a0 (2018-12-30).
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net