summaryrefslogtreecommitdiffstats
path: root/linenoise
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-20 08:33:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-20 08:33:46 -0700
commit24193f782a02939d6f4c7a197b44beb97202e1a0 (patch)
tree6b6dc1d31d6eb625f9ffe9a6a54bd9218f085f59 /linenoise
parent4c066cf5782381ca49de86af2ea07e2a259a8b64 (diff)
downloadtxr-24193f782a02939d6f4c7a197b44beb97202e1a0.tar.gz
txr-24193f782a02939d6f4c7a197b44beb97202e1a0.tar.bz2
txr-24193f782a02939d6f4c7a197b44beb97202e1a0.zip
linenoise: sync_data_to_to_buf loses pointless arg.
* linenoise/linenoise.c (sync_data_to_buf): prompt argument removed. The value passed is always l->mlmode, and that is what it indicates. (complete_line, complete_line, sync_data_to_buf, refresh_multiline, edit_insert): Updated calls.
Diffstat (limited to 'linenoise')
-rw-r--r--linenoise/linenoise.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index d84068bd..baaf4c6e 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -287,7 +287,7 @@ static void free_completions(lino_completions_t *lc) {
free(lc->cvec);
}
-static void sync_data_to_buf(lino_t *l, int prompt);
+static void sync_data_to_buf(lino_t *l);
static int compare_completions(const void *larg, const void *rarg)
{
@@ -339,7 +339,7 @@ static int complete_line(lino_t *ls) {
"%s%s", lc.cvec[i], ls->data + ls->dpos);
lt->dlen = n;
lt->dpos = strlen(lc.cvec[i]);
- sync_data_to_buf(lt, lt->mlmode);
+ sync_data_to_buf(lt);
refresh_line(lt);
} else {
refresh_line(ls);
@@ -375,7 +375,7 @@ static int complete_line(lino_t *ls) {
ls->dpos = lt->dpos;
ls->dlen = lt->dlen;
strcpy(ls->data, lt->data);
- sync_data_to_buf(ls, ls->mlmode);
+ sync_data_to_buf(ls);
refresh_line(ls);
}
stop = 1;
@@ -594,11 +594,11 @@ static void ab_free(struct abuf *ab) {
/* Convert raw data to display data, and recalculate
display length and position. */
-static void sync_data_to_buf(lino_t *l, int mlmode)
+static void sync_data_to_buf(lino_t *l)
{
char *dptr = l->data, *bptr = l->buf;
- if (mlmode)
+ if (l->mlmode)
bptr += snprintf(l->buf, sizeof l->buf, "%s",
l->prompt);
@@ -615,7 +615,7 @@ static void sync_data_to_buf(lino_t *l, int mlmode)
*bptr++ = ' ';
pos++;
} while (pos % 8 != 0);
- } else if (mlmode && ch == '\r') {
+ } else if (l->mlmode && ch == '\r') {
*bptr++ = '\r';
*bptr++ = '\n';
} else if (ch < ' ') {
@@ -790,7 +790,7 @@ static void refresh_multiline(lino_t *l) {
* refresh_multiline() according to the selected mode. */
static void refresh_line(lino_t *ls) {
- sync_data_to_buf(ls, ls->mlmode);
+ sync_data_to_buf(ls);
if (ls->mlmode)
refresh_multiline(ls);
@@ -890,7 +890,7 @@ static int edit_insert(lino_t *l, char c) {
l->dpos++;
l->dlen++;
l->data[l->dlen] = '\0';
- sync_data_to_buf(l, l->mlmode);
+ sync_data_to_buf(l);
if ((!l->mlmode && l->len == l->dlen && l->plen+l->len < l->cols) /* || mlmode */) {
/* Avoid a full update of the line in the
* trivial case. */