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.20 1999/06/09 17:34:32 marcus Exp $ + // $Id: Readline.pike,v 1.21 1999/06/09 18:03:14 hubbe Exp $      class OutputController   {    static private object outfd, term;    static private int xpos = 0, columns = 0;    static private mapping oldattrs = 0;       void disable()    {    catch{
pike.git/lib/modules/Stdio.pmod/Readline.pike:114:    int l = columns-xpos;    string line=s[..l-1];    int spos=search(reverse(line)," ");    if(spos==-1)    {    outfd->write(line);    }else{    l=strlen(line)-spos;    outfd->write(line[..l-2]);    } - // while(l<strlen(s) && s[l]==' ') l++; +     s=s[l..];    n-=l; - // if(l!=columns || !term->tgetflag("am")) -  if(n) +  xpos+=l; +  if(xpos<columns || !term->tgetflag("am"))    outfd->write((term->put("cr")||"")+(term->put("do")||"\n"));    xpos = 0;    }    }else{    while(xpos+n>=columns)    {    int l = columns-xpos;    outfd->write(s[..l-1]);    s=s[l..];    n-=l;