[gtk/block-cursor-fixes] textview: Don't eat block cursors




commit da1232caaf511798c3bebfde45f7e95dd673f48c
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 20 01:55:50 2021 -0400

    textview: Don't eat block cursors
    
    We need to render even an empty paragraph when
    it has a block cursor at the end. This fixes block
    cursors not showing up in empty lines.

 gtk/gtktextlayout.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index ea5e85a577..80fb0a2bf1 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -4213,7 +4213,8 @@ gtk_text_layout_snapshot (GtkTextLayout      *layout,
 
           if (line_display->node == NULL &&
               (pango_layout_get_character_count (line_display->layout) > 0 ||
-               selection_start_index != -1 || selection_end_index != -1))
+               selection_start_index != -1 || selection_end_index != -1 ||
+               line_display->has_block_cursor))
             {
               gtk_snapshot_push_collect (snapshot);
               render_para (crenderer, line_display,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]