diff --git a/addons/src/ao_bookmarklist.c b/addons/src/ao_bookmarklist.c index 88c2b67e0..0f41c9f43 100644 --- a/addons/src/ao_bookmarklist.c +++ b/addons/src/ao_bookmarklist.c @@ -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); } } }