tFix crash when moving cursor under certain conditions - ledit - Text editor (WIP)
HTML git clone git://lumidify.org/ledit.git (fast, but not encrypted)
HTML git clone https://lumidify.org/git/ledit.git (encrypted, but very slow)
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 5c1248701363874eadb48c5d6344ed0056186688
DIR parent 85e429f9ffab1451104d5aa92fd4adc40d84865a
HTML Author: lumidify <nobody@lumidify.org>
Date: Mon, 16 May 2022 13:57:10 +0200
Fix crash when moving cursor under certain conditions
Diffstat:
M view.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
DIR diff --git a/view.c b/view.c
t@@ -1047,9 +1047,8 @@ set_pango_text_and_highlight(ledit_view *view, size_t line) {
err_overflow();
pango_layout_set_text(cl->layout, ll->text, (int)ll->len);
set_line_layout_attrs(view, line, cl->layout);
- /* FIXME: is this guard necessary? */
- vl->softlines = ll->len > 0 ? pango_layout_get_line_count(cl->layout) : 1;
pango_layout_set_width(cl->layout, vl->w * PANGO_SCALE);
+ vl->softlines = pango_layout_get_line_count(cl->layout);
int w, h;
pango_layout_get_pixel_size(cl->layout, &w, &h);
if (h != vl->h) {