From 2c0ef17f9ede3abaa49b661fe5113412002378dd Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 21 Nov 2006 16:02:23 +0000 Subject: [PATCH] Undo cut from end of alignment, padding on --- src/jalview/commands/EditCommand.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index 97448e0..83e4417 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -240,6 +240,17 @@ public class EditCommand implements CommandI if(command.string!=null && command.string[i]!=null) { + if(command.position>=tmp.length()) + { + //This occurs if padding is on, and residues + //are removed from end of alignment + int length = command.position-tmp.length(); + while (length > 0) + { + tmp.append(command.gapChar); + length--; + } + } tmp.insert(command.position, command.string[i]); command.string[i] = null; } @@ -279,6 +290,7 @@ public class EditCommand implements CommandI int number, AlignmentI al) { + this.gapChar = al.getGapCharacter(); this.command = command; this.seqs = seqs; this.position = position; -- 1.7.10.2