summaryrefslogtreecommitdiff
path: root/src/completions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/completions.c')
-rw-r--r--src/completions.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/completions.c b/src/completions.c
index 4c62d71..fc32c38 100644
--- a/src/completions.c
+++ b/src/completions.c
@@ -35,7 +35,7 @@ completions_new (completion_fn list_fn)
c->last_match = NULL;
c->partial = NULL;
c->virgin = 1;
-
+
return c;
}
@@ -110,12 +110,12 @@ completions_prev_match (rp_completions *c)
cur = list_prev_entry (cur, &c->completion_list, node))
{
if (str_comp (sbuf_get (cur), c->partial, strlen (c->partial)))
- {
- /* We found a match so update our last_match pointer and
- return the string. */
- c->last_match = cur;
- return sbuf_get (cur);
- }
+ {
+ /* We found a match so update our last_match pointer and
+ return the string. */
+ c->last_match = cur;
+ return sbuf_get (cur);
+ }
}
return NULL;
@@ -133,12 +133,12 @@ completions_next_match (rp_completions *c)
cur = list_next_entry (cur, &c->completion_list, node))
{
if (str_comp (sbuf_get (cur), c->partial, strlen (c->partial)))
- {
- /* We found a match so update our last_match pointer and
- return the string. */
- c->last_match = cur;
- return sbuf_get (cur);
- }
+ {
+ /* We found a match so update our last_match pointer and
+ return the string. */
+ c->last_match = cur;
+ return sbuf_get (cur);
+ }
}
return NULL;
@@ -151,22 +151,22 @@ completions_complete (rp_completions *c, char *partial, int direction)
if (c->virgin)
{
completions_update (c, partial);
-
+
/* Since it's never been completed on and c->last_match points
- to the first element of the list which may be a match. So
- check it. FIXME: This is a bit of a hack. */
+ to the first element of the list which may be a match. So
+ check it. FIXME: This is a bit of a hack. */
if (c->last_match == NULL)
- return NULL;
+ return NULL;
/* c->last_match contains the first match in the forward
- direction. So if we're looking for the previous match, then
- check the previous element from last_match. */
+ direction. So if we're looking for the previous match, then
+ check the previous element from last_match. */
if (direction == COMPLETION_PREVIOUS)
- c->last_match = list_prev_entry (c->last_match, &c->completion_list, node);
+ c->last_match = list_prev_entry (c->last_match, &c->completion_list, node);
/* Now check if last_match is a match for partial. */
if (str_comp (sbuf_get (c->last_match), c->partial, strlen (c->partial)))
- return sbuf_get (c->last_match);
+ return sbuf_get (c->last_match);
}
if (c->last_match == NULL)