Skip to content

Instantly share code, notes, and snippets.

@natewalck
Forked from ccaviness/readline.c.ed
Created November 5, 2015 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natewalck/40f1c4629cd97ac0e97c to your computer and use it in GitHub Desktop.
Save natewalck/40f1c4629cd97ac0e97c to your computer and use it in GitHub Desktop.
H
/^#include/a
#include <stdlib.h>
.
/^get_history_item(/a
.
/^#ifdef *__APPLE__/c
/*
* Recent versions of libedit have corrected the off-by-one history indexes
* (though the Apple version emulates a true offset rather than using the
* event id). So we comment out the off-by-one fix.
*/
#if 0 /* __APPLE__ */
.
/^setup_readline/-1i
static char *
_dummy(const char *x, int y)
{
return NULL;
}
.
/using_history/i
rl_completion_entry_function = (Function *)_dummy;
.
/rl_initialize()/a
/* remove tab completion binding */
rl_parse_and_bind("bind ^I ed-insert");
.
/^call_readline(/a
.
/^#ifdef *__APPLE__/c
/*
* Recent versions of libedit have corrected the off-by-one history indexes
* (though the Apple version emulates a true offset rather than using the
* event id). So we comment out the off-by-one fix.
*/
#if 0 /* __APPLE__ */
.
w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment