From f5a270d54562ae1205f31a9ea49d5aa17257851c Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Thu, 16 Mar 2017 17:09:00 -0400 Subject: [PATCH] Fix for ich() corrupting display --- src/jexer/tterminal/DisplayLine.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jexer/tterminal/DisplayLine.java b/src/jexer/tterminal/DisplayLine.java index 75e2dfdd..5b3faf25 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); } } -- 2.27.0