Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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).
  • Loading branch information...
commit afb1eaaa0186d60723de40ad32ecc14b9267fe69 1 parent adbd162
@b4n b4n authored
Showing with 2 additions and 9 deletions.
  1. +2 −9 src/symbols.c
View
11 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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.