diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-08-18 20:08:39 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-08-18 20:08:39 (GMT) |
commit | c5631dd09fa9981e914ec9082c6270b69a719ca4 (patch) | |
tree | 0d50b3a82f466d2b8587ad20cfb0c93b180897ee /src/glibext/bufferview.c | |
parent | e5185bf4b4b6f76f15d3ff460a9cea40a8753284 (diff) |
Refreshed the rendering for newly added bookmarks.
Diffstat (limited to 'src/glibext/bufferview.c')
-rw-r--r-- | src/glibext/bufferview.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/glibext/bufferview.c b/src/glibext/bufferview.c index 769cd8b..7ac6718 100644 --- a/src/glibext/bufferview.c +++ b/src/glibext/bufferview.c @@ -75,6 +75,9 @@ static void g_buffer_view_finalize(GBufferView *); /* Accompagne une variation de la quantité de lignes du tampon. */ static void on_buffer_cache_size_changed(const GBufferCache *, bool, size_t, size_t, GBufferView *); +/* Réagit à la modification d'une ligne du tampon. */ +static void on_buffer_cache_line_updated(const GBufferCache *, size_t, GBufferView *); + /* Calcule la position idéale de curseur pour un point donné. */ static bool _g_buffer_view_compute_caret_full(GBufferView *, gint, GBufferLine *, size_t, const GDisplayOptions *, cairo_rectangle_int_t *, GLineCursor **); @@ -236,6 +239,7 @@ GBufferView *g_buffer_view_new(GBufferCache *cache, segcnt_list *highlighted) g_buffer_view_restrict(result, NULL, NULL); g_signal_connect(cache, "size-changed", G_CALLBACK(on_buffer_cache_size_changed), result); + g_signal_connect(cache, "line-updated", G_CALLBACK(on_buffer_cache_line_updated), result); if (highlighted != NULL) { @@ -253,6 +257,27 @@ GBufferView *g_buffer_view_new(GBufferCache *cache, segcnt_list *highlighted) /****************************************************************************** * * * Paramètres : cache = tampon de lignes cohérentes à manipuler. * +* index = indice de la première ligne actualisée. * +* * +* Description : Réagit à la modification d'une ligne du tampon. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void on_buffer_cache_line_updated(const GBufferCache *cache, size_t index, GBufferView *view) +{ + if (view->first <= index && index <= view->last) + g_signal_emit_by_name(view, "need-redraw"); + +} + + +/****************************************************************************** +* * +* Paramètres : cache = tampon de lignes cohérentes à manipuler. * * added = indication sur la variation de la taille du tampon. * * index = indice de la première ligne à traiter. * * count = nombre de lignes à traiter. * |