]> git.tdb.fi Git - libs/gltk.git/commitdiff
Fix a bug in selection handling when deleting text
authorMikko Rasa <tdb@tdb.fi>
Fri, 27 Sep 2019 11:29:09 +0000 (14:29 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 27 Sep 2019 12:19:40 +0000 (15:19 +0300)
source/entry.cpp

index 3212d85b1691a0082670f8dba996f1adc24193fe..1c66f9885fe8e5058a0ef0ae20e40ec3d83e1013 100644 (file)
@@ -407,7 +407,7 @@ void Entry::adjust_edit_position_for_change(unsigned pos, int change)
        {
                if(edit_pos>=pos)
                        edit_pos -= min<unsigned>(edit_pos-pos, -change);
-               if(selection_active)
+               if(selection_active && selection_pos>=pos)
                        selection_pos -= min<unsigned>(selection_pos-pos, -change);
        }