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.55 2004/02/26 21:51:17 agehall Exp $ + // $Id: Readline.pike,v 1.56 2004/11/02 20:01:53 grubba Exp $   #pike __REAL_VERSION__      //!   //! @fixme   //! Ought to have support for charset conversion.   class OutputController   {    static private .File outfd;    static private .Terminfo.Termcap term;    static private int xpos = 0, columns = 0;
pike.git/lib/modules/Stdio.pmod/Readline.pike:676:    function getbindingtc(string cap)    {    return getbindingstr(term->tgetstr(cap));    }       //!    string parsekey(string k)    {    if (k[..1]=="\\!")    k = term->tgetstr(k[2..]); -  else for(int i=0; i<sizeof(k); i++) +  else if (k[..3]=="^[\\!") { +  // Kludge for symbolic meta in bind table. +  if (k = term->tgetstr(k[4..])) +  k = "\033" + k; +  } else for(int i=0; i<sizeof(k); i++)    switch(k[i])    {    case '\\':    if(i<sizeof(k)-1)    switch(k[i+1]) {    case '0':    case '1':    case '2':    case '3':    case '4':
pike.git/lib/modules/Stdio.pmod/Readline.pike:827:    }       //!    void backward_delete_char()    {    int p = _readline->getcursorpos();    _readline->delete(p-1,p);    }       //! +  void delete_char() +  { +  int p = _readline->getcursorpos(); +  if (p<sizeof(_readline->gettext())) +  _readline->delete(p,p+1); +  } +  +  //!    void delete_char_or_eof()    {    int p = _readline->getcursorpos();    if (p<sizeof(_readline->gettext()))    _readline->delete(p,p+1);    else if(!sizeof(_readline->gettext()))    _readline->eof();    }       //!
pike.git/lib/modules/Stdio.pmod/Readline.pike:1065:    ({ "^M", newline }),    ({ "^N", down_history }),    ({ "^P", up_history }),    ({ "^R", redisplay }),    ({ "^T", transpose_chars }),    ({ "^U", kill_whole_line }),    ({ "^V", quoted_insert }),    ({ "^W", kill_region }),    ({ "^Y", yank }),    ({ "^?", backward_delete_char }), +  ({ "^X^X", swap_mark_and_point }), +  // Termcap-style    ({ "\\!ku", up_history }),    ({ "\\!kd", down_history }),    ({ "\\!kr", forward_char }),    ({ "\\!kl", backward_char }), -  ({ "^X^X", swap_mark_and_point }), +  ({ "\\!kD", delete_char }), +  ({ "\\!kb", backward_delete_char }), +  ({ "^[\\!kD", kill_word }), +  ({ "^[\\!kb", backward_kill_word }), +  ({ "\\!kh", beginning_of_line }), +  // Terminfo-style +  ({ "\\!kcuu1", up_history }), +  ({ "\\!kcud1", down_history }), +  ({ "\\!kcuf1", forward_char }), +  ({ "\\!kcub1", backward_char }), +  ({ "\\!kdch1", delete_char }), +  ({ "\\!kbs", backward_delete_char }), +  ({ "^[\\!kdch1", kill_word }), +  ({ "^[\\!kbs", backward_kill_word }), +  ({ "\\!khome", beginning_of_line }), +  ({ "\\!kend", end_of_line }), +  ({ "\\!kent", newline }),    });       //!    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++)