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

version» Context lines:

pike.git/lib/modules/Stdio.pmod/Readline.pike:1223:    if(sizeof(historylist)>1 && historylist[-2]==historylist[-1])    historylist = historylist[..<1];    }       //!    void set_max_history(int maxhist)    {    maxhistory = maxhist;    }    +  //! Pop the last string off the history, discarding it. +  //! If text is provided, will only pop that string. +  //! Returns 1 if a string was removed, 0 if not. +  int(0..1) pop(string|void text) +  { +  if (sizeof(historylist) < 2) return 0; //Not enough to pop +  if (text && historylist[-2] != text) return 0; //Wrong string +  historylist = historylist[..<2] + ({historylist[-1]}); +  return 1; +  } +     //!    void create(int maxhist, void|array(string) hist)    {    historylist = hist || ({ "" });    minhistory = historynum = 0;    maxhistory = maxhist;    }   }