From 87e9bbd830f6bab5d344852d45e46ae71f5bc113 Mon Sep 17 00:00:00 2001 From: sabetts Date: Wed, 28 May 2003 23:02:53 +0000 Subject: * src/completions.c (completions_complete): if direction is COMPLETION_PREVIOUS, then set last_match to it's previous entry. --- ChangeLog | 3 +++ NEWS | 7 +++++++ src/completions.c | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3b90e5b..40d9302 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-05-28 Shawn Betts + * src/completions.c (completions_complete): if direction is + COMPLETION_PREVIOUS, then set last_match to it's previous entry. + * src/globals.h (COMPLETION_NEXT): new define (COMPLETION_PREVIOUS): likewise diff --git a/NEWS b/NEWS index 08a0d2a..23ad0f5 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,13 @@ ratpoison NEWS --- history of user-visible changes. -*- outline -*- * Changes since 1.2.0-beta5 +** Completions +You can now type Tab and get completions on window names, group names, +and colon commands. + +** Line editing capabilities +You can now go forward a word, backward a char, delete a word, etc. + ** New commands gnewbg, gselect, groups, gmove, and gmerge These commands allow further manipulation of window groups. diff --git a/src/completions.c b/src/completions.c index 314bd23..1347e7c 100644 --- a/src/completions.c +++ b/src/completions.c @@ -136,6 +136,13 @@ completions_complete (rp_completions *c, char *partial, int direction) if (c->last_match == 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. */ + if (direction == COMPLETION_PREVIOUS) + 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); } -- cgit v1.2.3