summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-14 17:17:25 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-14 17:17:25 -0400
commit7391d9be671cd303fdebbf12bb9bc26958d13bf4 (patch)
tree706322b25ee785c6af9ab0c85cf025362f88f40d /ted.c
parent624399da9992b92f59daef4a79575c338e989e3e (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.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ted.c b/ted.c
index 9e4fe1b..bd3ac46 100644
--- a/ted.c
+++ b/ted.c
@@ -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);
+ }
}
}
}