diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-14 15:38:24 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-14 15:38:24 -0400 |
commit | 0d2d32d1a1090ce4c86510be8b10dc65ea1c0d62 (patch) | |
tree | 877739c34f040c2009480c6098aafbf7ab1ba9dd /buffer.c | |
parent | 472c3385d4b9fe8c3b55707accb646783298d0e2 (diff) |
fix weird scrolling with find menu open
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2160,9 +2160,6 @@ bool buffer_handle_click(Ted *ted, TextBuffer *buffer, v2 click, u8 times) { } if (buffer_pixels_to_pos(buffer, click, &buffer_pos)) { // user clicked on buffer - if (!ted->menu || buffer->is_line_buffer) { - ted_switch_to_buffer(ted, buffer); - } if (buffer == ted->active_buffer) { switch (ted->key_modifier) { case KEY_MODIFIER_SHIFT: @@ -2198,6 +2195,11 @@ bool buffer_handle_click(Ted *ted, TextBuffer *buffer, v2 click, u8 times) { } return true; } + // better to do this after handing click, because some stuff called by ted_switch_to_buffer + // needs to know the correct cursor pos + if (!ted->menu || buffer->is_line_buffer) { + ted_switch_to_buffer(ted, buffer); + } } return false; } |