rio: implement "look" (thanks lf94)
This commit is contained in:
parent
784e6ff8cd
commit
7c503e6f49
3 changed files with 29 additions and 0 deletions
|
@ -210,6 +210,7 @@ void wmousectl(Window*);
|
|||
void wmovemouse(Window*, Point);
|
||||
void wpaste(Window*);
|
||||
void wplumb(Window*);
|
||||
void wlook(Window*);
|
||||
void wrefresh(Window*, Rectangle);
|
||||
void wrepaint(Window*);
|
||||
void wresize(Window*, Image*, int);
|
||||
|
|
|
@ -62,6 +62,7 @@ enum
|
|||
Paste,
|
||||
Snarf,
|
||||
Plumb,
|
||||
Look,
|
||||
Send,
|
||||
Scroll,
|
||||
};
|
||||
|
@ -71,6 +72,7 @@ char *menu2str[] = {
|
|||
[Paste] "paste",
|
||||
[Snarf] "snarf",
|
||||
[Plumb] "plumb",
|
||||
[Look] "look",
|
||||
[Send] "send",
|
||||
[Scroll] "scroll",
|
||||
nil
|
||||
|
@ -816,6 +818,10 @@ button2menu(Window *w)
|
|||
wplumb(w);
|
||||
break;
|
||||
|
||||
case Look:
|
||||
wlook(w);
|
||||
break;
|
||||
|
||||
case Send:
|
||||
getsnarf();
|
||||
wsnarf(w);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue