X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FDisplayLine.java;h=15739486de2b6bf386d4641638d69a3e1c94c744;hb=eb29bbb5ec70c43895dd0f053630c7e3cd402cba;hp=75e2dfdd1f9a52e8444dde369cdd920a7b52b386;hpb=e16dda65585466c8987bd1efd718431450a96605;p=nikiroo-utils.git diff --git a/src/jexer/tterminal/DisplayLine.java b/src/jexer/tterminal/DisplayLine.java index 75e2dfd..1573948 100644 --- a/src/jexer/tterminal/DisplayLine.java +++ b/src/jexer/tterminal/DisplayLine.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2016 Kevin Lamonte + * Copyright (C) 2017 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -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); } }