diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-14 17:17:25 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-03-14 17:17:25 -0400 |
commit | 7391d9be671cd303fdebbf12bb9bc26958d13bf4 (patch) | |
tree | 706322b25ee785c6af9ab0c85cf025362f88f40d /ted.c | |
parent | 624399da9992b92f59daef4a79575c338e989e3e (diff) |
fix bug where modifications weren't detected
also fix find scroll bug REALLY for real this time!
Diffstat (limited to 'ted.c')
-rw-r--r-- | ted.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -106,9 +106,13 @@ static void ted_load_fonts(Ted *ted) { // sets the active buffer to this buffer, and updates active_node, etc. accordingly // you can pass NULL to buffer to make it so no buffer is active. void ted_switch_to_buffer(Ted *ted, TextBuffer *buffer) { + TextBuffer *search_buffer = find_search_buffer(ted); ted->active_buffer = buffer; ted->autocomplete = false; - if (ted->find) find_update(ted, true); + if (buffer != search_buffer) { + if (ted->find) + find_update(ted, true); // make sure find results are for this file + } if (buffer >= ted->buffers && buffer < ted->buffers + TED_MAX_BUFFERS) { ted->prev_active_buffer = buffer; @@ -303,8 +307,10 @@ static bool ted_save_all(Ted *ted) { success = false; // we haven't saved this buffer yet; we've just opened the "save as" menu. break; } else { - if (!buffer_save(buffer)) + if (!buffer_save(buffer)) { success = false; + ted_seterr_to_buferr(ted, buffer); + } } } } |