Changeset 3807


Ignore:
Timestamp:
09/16/03 01:38:04 (19 years ago)
Author:
piso
Message:

maybeScrollCaret(): honor SCROLL_CARET property.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/Editor.java

    r3796 r3807  
    33 *
    44 * Copyright (C) 1998-2003 Peter Graves
    5  * $Id: Editor.java,v 1.114 2003-09-15 16:20:04 piso Exp $
     5 * $Id: Editor.java,v 1.115 2003-09-16 01:38:04 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    29382938        if (mark != null)
    29392939            return;
    2940         final int dotLineNumber = dot.lineNumber();
    2941         final Line topLine = display.getTopLine();
    2942         if (dotLineNumber < topLine.lineNumber()) {
    2943             // Caret is above window.
    2944             addUndo(SimpleEdit.SCROLL_CARET);
    2945             dot.moveTo(topLine, 0);
    2946             updateDotLine();
    2947             moveCaretToDotCol();
    2948             goalColumn = 0;
    2949             return;
    2950         }
    2951         final Line bottomLine = display.getBottomLine();
    2952         if (dotLineNumber > bottomLine.lineNumber()) {
    2953             // Caret is below window.
    2954             addUndo(SimpleEdit.SCROLL_CARET);
    2955             updateDotLine();
    2956             dot.moveTo(bottomLine, 0);
    2957             updateDotLine();
    2958             moveCaretToDotCol();
    2959             goalColumn = 0;
     2940        if (buffer.getBooleanProperty(Property.SCROLL_CARET)) {
     2941            final int dotLineNumber = dot.lineNumber();
     2942            final Line topLine = display.getTopLine();
     2943            if (dotLineNumber < topLine.lineNumber()) {
     2944                // Caret is above window.
     2945                addUndo(SimpleEdit.SCROLL_CARET);
     2946                dot.moveTo(topLine, 0);
     2947                updateDotLine();
     2948                moveCaretToDotCol();
     2949                goalColumn = 0;
     2950                return;
     2951            }
     2952            final Line bottomLine = display.getBottomLine();
     2953            if (dotLineNumber > bottomLine.lineNumber()) {
     2954                // Caret is below window.
     2955                addUndo(SimpleEdit.SCROLL_CARET);
     2956                updateDotLine();
     2957                dot.moveTo(bottomLine, 0);
     2958                updateDotLine();
     2959                moveCaretToDotCol();
     2960                goalColumn = 0;
     2961            }
    29602962        }
    29612963    }
Note: See TracChangeset for help on using the changeset viewer.