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.9 1999/04/02 09:57:59 neotron Exp $ + // $Id: Readline.pike,v 1.10 1999/04/02 10:14:03 neotron 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:652:    {    _readline->setcursorpos(backward_find_word());    }       void forward_delete_word()    {    _readline->delete(_readline->getcursorpos(), forward_find_word());    }    void backward_delete_word()    { -  _readline->delete(backward_find_word()+1, _readline->getcursorpos()); +  int sp = backward_find_word() + 1; +  int ep = _readline->getcursorpos(); +  if((ep - sp) == 0) +  sp--; +  _readline->delete(sp, ep);    }       void kill_line()    {    _readline->delete(_readline->getcursorpos(), strlen(_readline->gettext()));    }       void kill_whole_line()    {    _readline->delete(0, strlen(_readline->gettext()));
pike.git/lib/modules/Stdio.pmod/Readline.pike:719:    });       static void set_default_bindings()    {    object ic = _readline->get_input_controller();    ic->nullbindings();    for(int i=' '; i<'\177'; i++)    ic->bindstr(sprintf("%c", i), self_insert_command);    for(int i='\240'; i<='\377'; i++)    ic->bindstr(sprintf("%c", i), self_insert_command); +     foreach(default_bindings, array(string|function) b)    ic->bind(@b);    }       void create(object readline)    {    _readline = readline;    set_default_bindings();    }