From afb1eaaa0186d60723de40ad32ecc14b9267fe69 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Mon, 17 Sep 2012 14:26:39 +0200 Subject: [PATCH] Remove improper caching of the current function The code assumed that if both old and new fold levels were above the minimal function fold level the function couldn't have been changed, which is wrong if a function can appear both inside and outside another fold level (e.g. inside or outside a class). --- src/symbols.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/symbols.c b/src/symbols.c index 64790b03..38968f7e 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -1979,15 +1979,8 @@ static gboolean current_function_changed(GeanyDocument *doc, gint cur_line, gint /* if the line has only changed by 1 */ if (abs(cur_line - old_line) == 1) { - const gint fn_fold = - get_function_fold_number(doc); - /* It's the same function if the fold number hasn't changed, or both the new - * and old fold numbers are above the function fold number. */ - gboolean same = - fold_num == old_fold_num || - (old_fold_num > fn_fold && fold_num > fn_fold); - - ret = ! same; + /* It's the same function if the fold number hasn't changed */ + ret = (fold_num != old_fold_num); } else ret = TRUE; }