From 190d5f1a616791deaaf68e9a86eebba67bcae193 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Thu, 15 Oct 2020 15:21:05 +0100 Subject: [PATCH] Bug 797971 - Inserting description text behaves oddly This is best observed when trying to insert a character, say x when the cursor is before the last character, the cursor will jump to the end like... ABCD|E results in ABCDxE| It can also affect when inserting/changing text that has come from the quick fill the cursor may end up in the wrong place. Changed a test condition to use the incoming new character length value instead of the existing cell one. --- gnucash/register/register-core/quickfillcell.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gnucash/register/register-core/quickfillcell.c b/gnucash/register/register-core/quickfillcell.c index 39332eeabd..f1d4817b1f 100644 --- a/gnucash/register/register-core/quickfillcell.c +++ b/gnucash/register/register-core/quickfillcell.c @@ -198,7 +198,7 @@ gnc_quickfill_cell_modify_verify (BasicCell *_cell, } /* If we are inserting in the middle, just accept */ - if (*cursor_position < _cell->value_chars) + if (*cursor_position < newval_chars) { gnc_basic_cell_set_value_internal (&cell->cell, newval); gnc_quickfill_cell_set_original (cell, NULL); @@ -233,8 +233,6 @@ gnc_quickfill_cell_modify_verify (BasicCell *_cell, if (cell->original != NULL) newval = cell->original; - *cursor_position = -1; - gnc_basic_cell_set_value_internal (&cell->cell, newval); return; }