X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fcommands%2FEditCommand.java;h=83e44174ba49be74307137bd15c2349ab57da63d;hb=d587f1aa61946dc14f6f089cf1dc2a3116cfb773;hp=7218115323f4e4994994b814cd173b1ccbe42560;hpb=91d2b7cf873f1437a3e21049c5aa6c7a7117e820;p=jalview.git diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index 7218115..83e4417 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -99,6 +99,11 @@ public class EditCommand implements CommandI return edits==null?0:edits.length; } + public AlignmentI getAlignment() + { + return edits[0].al; + } + public void appendEdit(String command, SequenceI[] seqs, @@ -235,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; } @@ -274,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;