From: Kevin Lamonte Date: Thu, 16 Mar 2017 21:09:00 +0000 (-0400) Subject: Fix for ich() corrupting display X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=f5a270d54562ae1205f31a9ea49d5aa17257851c;p=nikiroo-utils.git Fix for ich() corrupting display --- diff --git a/src/jexer/tterminal/DisplayLine.java b/src/jexer/tterminal/DisplayLine.java index 75e2dfd..5b3faf2 100644 --- a/src/jexer/tterminal/DisplayLine.java +++ b/src/jexer/tterminal/DisplayLine.java @@ -161,7 +161,8 @@ public final class DisplayLine { */ public void insert(final int idx, final Cell newCell) { System.arraycopy(chars, idx, chars, idx + 1, chars.length - idx - 1); - chars[idx] = newCell; + chars[idx] = new Cell(); + chars[idx].setTo(newCell); } /** @@ -214,7 +215,8 @@ public final class DisplayLine { */ public void delete(final int idx, final Cell newCell) { System.arraycopy(chars, idx + 1, chars, idx, chars.length - idx - 1); - chars[chars.length - 1] = newCell; + chars[chars.length - 1] = new Cell(); + chars[chars.length - 1].setTo(newCell); } }