diff options
author | Rory Dudley | 2024-12-12 22:45:53 -0700 |
---|---|---|
committer | Rory Dudley | 2024-12-13 15:02:16 -0700 |
commit | 604b148d94b2b48cf2ad1608b5a2d322e341de3c (patch) | |
tree | 19f08f9263e2f08a7c88d7b25a213bd3c288cb05 /src/poem/recite | |
parent | fa9ec0c377305126f4c810be198bdca68d71a275 (diff) | |
download | dwarvish-604b148d94b2b48cf2ad1608b5a2d322e341de3c.tar.gz |
More buffer bug fixes
Always append a newline to the end of the buffer. This ensures that the
shell will not quit if the user simply presses the return key without
any other input.
Fix a disrepency between the buffer length, and text width in the comp
function. The length of the buffer is the number of indices, whereas the
width of the buffer is the summed width of each character within the
buffer. We need the length when operating on the buffer's indicies, but
the width when dealing with what actually gets outputted to the shell.
In this case, the the width was being used where the length (bpos)
should've been, and was causing an index out of bounds error for any
strings that contained a character wider than 1. This rectifies the
issue, as well as refactors some code that was (appropriately) using the
width.
Signed-off-by: Rory Dudley <rory@netc.lu>
Diffstat (limited to 'src/poem/recite')
0 files changed, 0 insertions, 0 deletions