Changeset 16937 for trunk


Ignore:
Timestamp:
06/27/13 22:21:34 (11 years ago)
Author:
tbretz
Message:
Some fixes for the display of command completion results; fixed the removal of double entries from the history; added Home and End to key bindings output
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Readline.cc

    r16917 r16937  
    5050
    5151 - <A HREF="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html">GNU Readline</A>
     52 - <A HREF="http://www.rendezvousalpha.com/f/bash_d596c169?fn=1670">GNU Readline (src code)</A>
    5253
    5354 */
     
    5960#include <iostream>
    6061
     62#include <sys/ioctl.h>
    6163#include <readline/readline.h>
    6264#include <readline/history.h>
     
    328330        rl_on_new_line();
    329331
    330     if (rl_prompt==p)
    331     {
    332         Redisplay();
     332    if (rl_prompt==p && !newline)
    333333        return;
    334     }
    335334
    336335    UpdatePrompt(p);
     
    387386{
    388387    rl_display_match_list(matches, num, max);
     388    rl_forced_update_display();
    389389}
    390390
     
    574574            break;
    575575
    576         // It seems like history_search_pos works more like
    577         // history_search_prefix, therefore the identity is checked again
    578         const HIST_ENTRY *e = history_get(p+1);
    579         if (e && str==e->line)
    580             free(remove_history(p));
     576        HIST_ENTRY *e = remove_history(p--);
     577
     578        free(e->line);
     579        free(e);
    581580    }
    582581
     
    10311030    fprintf(rl_outstream, "   Ctrl-left       One word backward\n");
    10321031    fprintf(rl_outstream, "   Ctrl-right      One word forward\n");
     1032    fprintf(rl_outstream, "   Home            Beginning of line\n");
     1033    fprintf(rl_outstream, "   End             End of line\n");
    10331034    fprintf(rl_outstream, "   Ctrl-d          Quit\n");
    10341035    fprintf(rl_outstream, "   Ctrl-y          Delete line\n");
Note: See TracChangeset for help on using the changeset viewer.