Changeset 4966


Ignore:
Timestamp:
12/04/03 15:17:06 (17 years ago)
Author:
piso
Message:

formatLine(): call line.setFlags(STATE_PROMPT) at end of buffer if appropriate.

File:
1 edited

Legend:

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

    r507 r4966  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: ShellFormatter.java,v 1.4 2003-01-04 17:47:25 piso Exp $
     5 * $Id: ShellFormatter.java,v 1.5 2003-12-04 15:17:06 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4949        final String text = getDetabbedText(line);
    5050        if (line.flags() == STATE_PROMPT) {
    51             addSegment(text, SHELL_FORMAT_PROMPT);
     51            REMatch match = promptRE.getMatch(text);
     52            if (match != null) {
     53                final int end = match.getEndIndex();
     54                addSegment(text, 0, end, SHELL_FORMAT_PROMPT);
     55                addSegment(text, end, SHELL_FORMAT_INPUT);
     56            } else
     57                addSegment(text, SHELL_FORMAT_PROMPT);
    5258            return segmentList;
    5359        }
     
    7884                REMatch match = promptRE.getMatch(text);
    7985                if (match != null) {
     86                    line.setFlags(STATE_PROMPT);
    8087                    final int end = match.getEndIndex();
    8188                    addSegment(text, 0, end, SHELL_FORMAT_PROMPT);
Note: See TracChangeset for help on using the changeset viewer.