pike.git / lib / modules / Stdio.pmod / Readline.pike

version» Context lines:

pike.git/lib/modules/Stdio.pmod/Readline.pike:1: - // $Id: Readline.pike,v 1.25 1999/06/22 21:53:39 marcus Exp $ + // $Id: Readline.pike,v 1.26 1999/09/10 16:17:59 noring Exp $      class OutputController   {    static private object outfd, term;    static private int xpos = 0, columns = 0;    static private mapping oldattrs = 0;      #define BLINK 1   #define BOLD 2   #define DIM 4
pike.git/lib/modules/Stdio.pmod/Readline.pike:1382:    }   }      void set_blocking()   {    set_nonblocking(0);   }      string edit(string data, string|void local_prompt)   { +  string old_prompt; +     if(newline_func == read_newline)    return 0; -  +  +  if(local_prompt) +  { +  old_prompt = get_prompt(); +  set_prompt(local_prompt); +  } +     function oldnl = newline_func;    output_controller->write(local_prompt||prompt);    initline();    newline_func = read_newline;    readtext = "";    output_controller->enable();    insert(data, 0);    int res = input_controller->run_blocking();    set_nonblocking(oldnl); -  +  +  if(local_prompt) +  set_prompt(old_prompt); +     return (res>=0 || sizeof(readtext)) && readtext;   }      string read(string|void prompt)   {    return edit("", prompt);   }      void enable_history(object(History)|int hist)   {