Adjust to the libedit enhancements some functions now take more parameters.
Partially submitted by: kris
This commit is contained in:
parent
757eeda04b
commit
dbb3c034a4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84262
@ -127,6 +127,7 @@ int try_epsv; /* try EPSV for this session */
|
|||||||
int editing; /* command line editing enabled */
|
int editing; /* command line editing enabled */
|
||||||
EditLine *el; /* editline(3) status structure */
|
EditLine *el; /* editline(3) status structure */
|
||||||
History *hist; /* editline(3) history structure */
|
History *hist; /* editline(3) history structure */
|
||||||
|
HistEvent he; /* editline(3) history structure */
|
||||||
char *cursor_pos; /* cursor position we're looking for */
|
char *cursor_pos; /* cursor position we're looking for */
|
||||||
size_t cursor_argc; /* location of cursor in margv */
|
size_t cursor_argc; /* location of cursor in margv */
|
||||||
size_t cursor_argo; /* offset of cursor in margv[cursor_argc] */
|
size_t cursor_argo; /* offset of cursor in margv[cursor_argc] */
|
||||||
|
@ -408,7 +408,7 @@ cmdscanner(top)
|
|||||||
}
|
}
|
||||||
memcpy(line, buf, num);
|
memcpy(line, buf, num);
|
||||||
line[num] = '\0';
|
line[num] = '\0';
|
||||||
history(hist, H_ENTER, buf);
|
history(hist, &he, H_ENTER, buf);
|
||||||
}
|
}
|
||||||
#endif /* !SMALL */
|
#endif /* !SMALL */
|
||||||
|
|
||||||
|
@ -839,9 +839,10 @@ void
|
|||||||
controlediting()
|
controlediting()
|
||||||
{
|
{
|
||||||
if (editing && el == NULL && hist == NULL) {
|
if (editing && el == NULL && hist == NULL) {
|
||||||
el = el_init(__progname, stdin, stdout); /* init editline */
|
/* init editline */
|
||||||
|
el = el_init(__progname, stdin, stdout, stderr);
|
||||||
hist = history_init(); /* init the builtin history */
|
hist = history_init(); /* init the builtin history */
|
||||||
history(hist, H_EVENT, 100); /* remember 100 events */
|
history(hist, &he, H_EVENT, 100); /* remember 100 events */
|
||||||
el_set(el, EL_HIST, history, hist); /* use history */
|
el_set(el, EL_HIST, history, hist); /* use history */
|
||||||
|
|
||||||
el_set(el, EL_EDITOR, "emacs"); /* default editor is emacs */
|
el_set(el, EL_EDITOR, "emacs"); /* default editor is emacs */
|
||||||
|
Loading…
Reference in New Issue
Block a user