Changeset 1128


Ignore:
Timestamp:
Jun 30, 2011, 6:19:52 PM (6 years ago)
Author:
stefan
Message:

restore old caret position after table realignment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/addon/ColumnRealigner.java

    r996 r1128  
    22
    33import jlatexeditor.JLatexEditorJFrame;
    4 import sce.component.SCEDocument;
    5 import sce.component.SCEDocumentPosition;
    6 import sce.component.SCEPane;
    7 import sce.component.SCERange;
     4import sce.component.*;
    85
    96import java.util.ArrayList;
     
    2623    SCEDocument doc = pane.getDocument();
    2724
     25    SCEPosition oldPosition = new SCEDocumentPosition(pane.getCaret().getRow(), pane.getCaret().getColumn());
     26
    2827    ArrayList<Character> columns = new ArrayList<Character>();
    2928    if (!doc.hasSelection()) {
     
    8281
    8382    doc.replace(starPos, endPos, newText);
     83    pane.getCaret().moveTo(oldPosition, false);
    8484  }
    8585
Note: See TracChangeset for help on using the changeset viewer.