diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-26 13:05:54 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-26 13:05:54 -0500 |
commit | ef6ae187289dd58a3b03da8b991a8099616a763d (patch) | |
tree | b7e22acc956ebf9c10f6df75a06cab6c1c0fc15d /buffer.c | |
parent | a63ae9425561f3d2197c5d220be89fe92900adec (diff) |
fix bug where selection_pos was invalid
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -131,8 +131,11 @@ static void buffer_pos_validate(TextBuffer *buffer, BufferPos *p) { p->index = line_len; } +// validate the cursor and selection positions static void buffer_validate_cursor(TextBuffer *buffer) { buffer_pos_validate(buffer, &buffer->cursor_pos); + if (buffer->selection) + buffer_pos_validate(buffer, &buffer->selection_pos); } static bool buffer_pos_valid(TextBuffer *buffer, BufferPos p) { |