JAL-2526 don't retain lastColumnPosition from an invalidated cursor
[jalview.git] / src / jalview / datamodel / Sequence.java
index 96747e4..783b1bc 100755 (executable)
@@ -723,7 +723,10 @@ public class Sequence extends ASequence implements SequenceI
    */
   protected void updateCursor(int residuePos, int column, int startColumn)
   {
-    int endColumn = cursor == null ? 0 : cursor.lastColumnPosition;
+    /*
+     * preserve end residue column provided cursor was valid
+     */
+    int endColumn = isValidCursor(cursor) ? cursor.lastColumnPosition : 0;
     if (residuePos == this.end)
     {
       endColumn = column;