From: amwaterhouse Date: Tue, 21 Nov 2006 16:02:23 +0000 (+0000) Subject: Undo cut from end of alignment, padding on X-Git-Tag: Release_2_2~70 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2c0ef17f9ede3abaa49b661fe5113412002378dd;p=jalview.git Undo cut from end of alignment, padding on --- 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;