Undo cut from end of alignment, padding on
authoramwaterhouse <Andrew Waterhouse>
Tue, 21 Nov 2006 16:02:23 +0000 (16:02 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 21 Nov 2006 16:02:23 +0000 (16:02 +0000)
src/jalview/commands/EditCommand.java

index 97448e0..83e4417 100644 (file)
@@ -240,6 +240,17 @@ public class EditCommand implements CommandI
 \r
       if(command.string!=null && command.string[i]!=null)\r
       {\r
+        if(command.position>=tmp.length())\r
+        {\r
+          //This occurs if padding is on, and residues\r
+          //are removed from end of alignment\r
+          int length = command.position-tmp.length();\r
+          while (length > 0)\r
+          {\r
+            tmp.append(command.gapChar);\r
+            length--;\r
+          }\r
+        }\r
         tmp.insert(command.position, command.string[i]);\r
         command.string[i] = null;\r
       }\r
@@ -279,6 +290,7 @@ public class EditCommand implements CommandI
          int number,\r
          AlignmentI al)\r
     {\r
+      this.gapChar = al.getGapCharacter();\r
       this.command = command;\r
       this.seqs = seqs;\r
       this.position = position;\r