summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio/wind.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-01-11 10:14:35 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-01-11 10:14:35 +0100
commit7c503e6f49b140a99535c317092cc2f32d2a7140 (patch)
tree84a4d9595f5d7ddd3a8cc01de6b7d53937bd9567 /sys/src/cmd/rio/wind.c
parent784e6ff8cd431e80800e0d7b0a4c5f3b385d8d89 (diff)
rio: implement "look" (thanks lf94)
Diffstat (limited to 'sys/src/cmd/rio/wind.c')
-rw-r--r--sys/src/cmd/rio/wind.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c
index 9b8f38d01..0c33c9616 100644
--- a/sys/src/cmd/rio/wind.c
+++ b/sys/src/cmd/rio/wind.c
@@ -889,6 +889,28 @@ wplumb(Window *w)
plumbfree(m);
}
+void
+wlook(Window *w)
+{
+ int i, n, e;
+
+ i = w->q1;
+ n = i - w->q0;
+ e = w->nr - n;
+ if(n <= 0 || e < n)
+ return;
+
+ while(runestrncmp(w->r+w->q0, w->r+i, n) != 0){
+ if(i < e)
+ i++;
+ else
+ i = 0;
+ }
+
+ wsetselect(w, i, i+n);
+ wshow(w, i);
+}
+
int
winborder(Window *w, Point xy)
{