From: Olaf Wintermann Date: Mon, 16 Feb 2026 18:07:04 +0000 (+0100) Subject: fix get_prev_list setting remove_offset even when no list was found X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=HEAD;p=note.git fix get_prev_list setting remove_offset even when no list was found --- diff --git a/application/gtk-text.c b/application/gtk-text.c index 2d0a081..4be682b 100644 --- a/application/gtk-text.c +++ b/application/gtk-text.c @@ -305,7 +305,6 @@ static int get_prev_list(GtkTextBuffer *buffer, const GtkTextIter *iter, int *de int list_depth = 0; int list_style = 0; int list_num = 0; - int remove_list_off = -1; GtkTextIter iter2 = *iter; GtkTextChildAnchor *anchor = NULL; @@ -337,18 +336,17 @@ static int get_prev_list(GtkTextBuffer *buffer, const GtkTextIter *iter, int *de chars_per_line++; } - if(chars_per_line == 1) { - // empty list element -> inserting a newline terminates the list - list_depth = 0; - *remove_offset = off + 1; - } - if(list_depth > 0) { - *depth = list_depth; - *style = list_style; - *num = list_num; - *remove_offset = -1; - return 1; + if(chars_per_line == 1) { + list_depth = 0; + *remove_offset = off + 1; + } else { + *depth = list_depth; + *style = list_style; + *num = list_num; + *remove_offset = -1; + return 1; + } } return 0; }