Skip to content

Commit

Permalink
Update bookmark list also on any line changes in the document
Browse files Browse the repository at this point in the history
In addition to updating the bookmark list on document notebook tab change
and adding/removing line markers, also rebuild the bookmark list
when the text in the document changes with lines added or deleted.

Should fix SF bugs geany#129 and geany#39.
  • Loading branch information
eht16 committed Sep 16, 2015
1 parent 0d130be commit a47cb83
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions addons/src/ao_bookmarklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,16 +464,23 @@ void ao_bookmark_list_update_marker(AoBookmarkList *bm, GeanyEditor *editor, SCN
{
AoBookmarkListPrivate *priv = AO_BOOKMARK_LIST_GET_PRIVATE(bm);

if (priv->enable_bookmarklist &&
nt->nmhdr.code == SCN_MODIFIED && nt->modificationType == SC_MOD_CHANGEMARKER)
if (priv->enable_bookmarklist && nt->nmhdr.code == SCN_MODIFIED)
{
if (sci_is_marker_set_at_line(editor->sci, nt->line, 1))
if (nt->modificationType == SC_MOD_CHANGEMARKER)
{
add_line(bm, editor->sci, nt->line);
if (sci_is_marker_set_at_line(editor->sci, nt->line, 1))
{
add_line(bm, editor->sci, nt->line);
}
else
{
delete_line(bm, nt->line);
}
}
else
else if (nt->linesAdded != 0)
{
delete_line(bm, nt->line);
/* if any lines changed, refresh the whole list as we refer line numbers */
ao_bookmark_list_update(bm, editor->document);
}
}
}
Expand Down

0 comments on commit a47cb83

Please sign in to comment.