Changeset 174


Ignore:
Timestamp:
10/24/02 17:32:59 (21 years ago)
Author:
piso
Message:

Get prompt from buffer.

File:
1 edited

Legend:

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

    r165 r174  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: LispShellFormatter.java,v 1.1 2002-10-19 14:06:57 piso Exp $
     5 * $Id: LispShellFormatter.java,v 1.2 2002-10-24 17:32:59 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3232    private static final byte FORMAT_PROMPT = 1;
    3333    private static final byte FORMAT_INPUT  = 2;
     34
     35    private final RE defaultPromptRE =
     36        new UncheckedRE("^[^>\\*\\]]*[>\\*\\]] *");
    3437
    3538    public LispShellFormatter(Buffer buffer)
     
    7679    }
    7780
    78     private final RE promptRE = new UncheckedRE("^[^>\\*\\]]*[>\\*\\]] *");
    79 
    8081    private int getPromptEndIndex(String text)
    8182    {
     
    9192        if (text.startsWith("* "))
    9293            return 2;
     94        final RE promptRE;
     95        if (buffer instanceof CommandInterpreter)
     96            promptRE = ((CommandInterpreter)buffer).getPromptRE();
     97        else
     98            promptRE = defaultPromptRE;
    9399        REMatch match = promptRE.getMatch(text);
    94100        if (match != null)
Note: See TracChangeset for help on using the changeset viewer.