summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-05-28 23:02:53 +0000
committersabetts <sabetts>2003-05-28 23:02:53 +0000
commit87e9bbd830f6bab5d344852d45e46ae71f5bc113 (patch)
tree2fe337bd0851f9481c66ba1ec52a190c1f400aaa
parent99d6bf980b231670ef58d12e082cfd52e0513707 (diff)
downloadratpoison-87e9bbd830f6bab5d344852d45e46ae71f5bc113.zip
* src/completions.c (completions_complete): if direction is
COMPLETION_PREVIOUS, then set last_match to it's previous entry.
-rw-r--r--ChangeLog3
-rw-r--r--NEWS7
-rw-r--r--src/completions.c7
3 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b90e5b..40d9302 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2003-05-28 Shawn Betts <sabetts@sfu.ca>
+ * 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);
}