Changeset 4862


Ignore:
Timestamp:
11/21/03 17:05:16 (18 years ago)
Author:
piso
Message:

getInputFromHistory(): match current input if any.

File:
1 edited

Legend:

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

    r3822 r4862  
    33 *
    44 * Copyright (C) 1998-2003 Peter Graves
    5  * $Id: CommandInterpreter.java,v 1.19 2003-09-16 16:54:30 piso Exp $
     5 * $Id: CommandInterpreter.java,v 1.20 2003-11-21 17:05:16 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    304304    }
    305305
     306    private String currentInput;
     307
    306308    private void getInputFromHistory(int direction)
    307309    {
     
    316318            return;
    317319        }
    318         if (editor.getLastCommand() != COMMAND_HISTORY)
     320        if (editor.getLastCommand() != COMMAND_HISTORY) {
    319321            history.reset();
    320 
    321         Position begin = getEndOfOutput().copy();
    322         Position end = getEnd();
    323         Region r = new Region(editor.getBuffer(), begin, end);
    324         String currentInput = r.toString();
     322            Position begin = getEndOfOutput().copy();
     323            Position end = getEnd();
     324            Region r = new Region(editor.getBuffer(), begin, end);
     325            currentInput = r.toString();
     326        }
    325327        String s;
    326328        while (true) {
     
    329331                break;
    330332            s = s.trim();
    331             if (!s.equals(currentInput))
     333            if (s.equals(currentInput))
     334                continue;
     335            if (currentInput.length() == 0 || s.startsWith(currentInput))
    332336                break;
    333337        }
Note: See TracChangeset for help on using the changeset viewer.