mcabber/src/screen.c
changeset 263 1bcc3eec08f0
parent 261 259ed1de5bdc
child 265 49e9e02dd6d0
equal deleted inserted replaced
262:ab6f83a82811 263:1bcc3eec08f0
  1464       case 9:     // Tab
  1464       case 9:     // Tab
  1465           scr_handle_tab();
  1465           scr_handle_tab();
  1466           check_offset(0);
  1466           check_offset(0);
  1467           break;
  1467           break;
  1468       case '\n':  // Enter
  1468       case '\n':  // Enter
       
  1469       case 15:    // Ctrl-o ("accept-line-and-down-history")
  1469           if (process_line(inputLine))
  1470           if (process_line(inputLine))
  1470             return 255;
  1471             return 255;
  1471           // Add line to history
  1472           // Add line to history
  1472           scr_cmdhisto_addline(inputLine);
  1473           scr_cmdhisto_addline(inputLine);
  1473           cmdhisto_cur = NULL;
       
  1474           // Reset the line
  1474           // Reset the line
  1475           ptr_inputline = inputLine;
  1475           ptr_inputline = inputLine;
  1476           *ptr_inputline = 0;
  1476           *ptr_inputline = 0;
  1477           inputline_offset = 0;
  1477           inputline_offset = 0;
       
  1478 
       
  1479           if (key == '\n')          // Enter
       
  1480           {
       
  1481             // Reset history line pointer
       
  1482             cmdhisto_cur = NULL;
       
  1483           } else {                  // down-history
       
  1484             // Use next history line instead of a blank line
       
  1485             const char *l = scr_cmdhisto_next("", 0);
       
  1486             if (l)
       
  1487               strcpy(inputLine, l);
       
  1488             // Reset backup history line
       
  1489             cmdhisto_backup[0] = 0;
       
  1490           }
  1478           break;
  1491           break;
  1479       case KEY_UP:
  1492       case KEY_UP:
  1480           {
  1493           {
  1481             const char *l = scr_cmdhisto_prev(inputLine,
  1494             const char *l = scr_cmdhisto_prev(inputLine,
  1482                     ptr_inputline-inputLine);
  1495                     ptr_inputline-inputLine);