Changeset 3822
- Timestamp:
- 09/16/03 16:54:30 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/CommandInterpreter.java
r1837 r3822 3 3 * 4 4 * Copyright (C) 1998-2003 Peter Graves 5 * $Id: CommandInterpreter.java,v 1.1 8 2003-05-16 17:43:01piso Exp $5 * $Id: CommandInterpreter.java,v 1.19 2003-09-16 16:54:30 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 89 89 public final synchronized Position getEndOfOutput() 90 90 { 91 if (posEndOfOutput != null) { 92 if (posEndOfOutput.getOffset() > posEndOfOutput.getLineLength()) { 93 Log.debug("posEndOfOutput adjusting offset"); 94 posEndOfOutput.setOffset(posEndOfOutput.getLineLength()); 95 } 96 } 91 97 return posEndOfOutput; 92 98 } … … 133 139 final Editor editor = Editor.currentEditor(); 134 140 final Line dotLine = editor.getDotLine(); 135 if ( posEndOfOutput== null) {141 if (getEndOfOutput() == null) { 136 142 // Ignore input before first prompt is displayed. 137 143 dotLine.setText(""); … … 217 223 { 218 224 Editor editor = Editor.currentEditor(); 219 if (editor.getMark() != null || posEndOfOutput== null ||225 if (editor.getMark() != null || getEndOfOutput() == null || 220 226 editor.getDot().isBefore(posEndOfOutput)) { 221 227 // There's a marked block, or we're not at the command line. … … 267 273 protected void backspace() 268 274 { 269 if ( posEndOfOutput== null)275 if (getEndOfOutput() == null) 270 276 return; 271 277 boolean ok = true; … … 300 306 private void getInputFromHistory(int direction) 301 307 { 302 if ( posEndOfOutput== null) {308 if (getEndOfOutput() == null) { 303 309 // No prompt yet. 304 310 return; … … 313 319 history.reset(); 314 320 315 Position begin = posEndOfOutput.copy();321 Position begin = getEndOfOutput().copy(); 316 322 Position end = getEnd(); 317 323 Region r = new Region(editor.getBuffer(), begin, end); … … 329 335 CompoundEdit compoundEdit = beginCompoundEdit(); 330 336 editor.addUndo(SimpleEdit.MOVE); 331 editor.setDot( posEndOfOutput.copy());337 editor.setDot(getEndOfOutput().copy()); 332 338 editor.setMark(getEnd()); 333 339 editor.deleteRegion(); … … 340 346 resetUndo(); 341 347 } 342 for (Line line = posEndOfOutput.getLine(); line != null; line = line.next())348 for (Line line = getEndOfOutput().getLine(); line != null; line = line.next()) 343 349 line.setFlags(STATE_INPUT); 344 350 editor.setCurrentCommand(COMMAND_HISTORY); … … 361 367 renumber(); 362 368 enforceOutputLimit(Property.SHELL_OUTPUT_LIMIT); 363 posEndOfOutput = pos.copy();369 setEndOfOutput(pos.copy()); 364 370 } else { 365 371 setText(s); 366 posEndOfOutput = getEnd().copy();372 setEndOfOutput(getEnd().copy()); 367 373 } 368 374 }
Note: See TracChangeset
for help on using the changeset viewer.