summaryrefslogtreecommitdiff
path: root/sys/src/cmd/samterm
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-10-21 15:29:07 -0700
committerOri Bernstein <ori@eigenstate.org>2019-10-21 15:29:07 -0700
commit9314883aff7950820a26782d863a78d18be93635 (patch)
tree37112cba223a0bf8e6d7835644f3fcddec303eb6 /sys/src/cmd/samterm
parent7682a24bc514a9348ec01b1a3d66f9c6568373c4 (diff)
Make ctrl+g focus text windows and cycle zeroxed copies (thanks kvik)
Diffstat (limited to 'sys/src/cmd/samterm')
-rw-r--r--sys/src/cmd/samterm/main.c17
-rw-r--r--sys/src/cmd/samterm/samterm.h4
2 files changed, 20 insertions, 1 deletions
diff --git a/sys/src/cmd/samterm/main.c b/sys/src/cmd/samterm/main.c
index b01eb0e03..14444e0ee 100644
--- a/sys/src/cmd/samterm/main.c
+++ b/sys/src/cmd/samterm/main.c
@@ -485,6 +485,7 @@ nontypingkey(int c)
case Ksoh:
case Kenq:
case Kstx:
+ case Kbel:
return 1;
}
return 0;
@@ -658,6 +659,22 @@ type(Flayer *l, int res) /* what a bloody mess this is */
a = t->rasp.nrunes;
flsetselect(l, a, a);
center(l, a);
+ }else if(c == Kbel){
+ int i;
+ if(work == nil)
+ return;
+ if(which != work){
+ current(work);
+ return;
+ }
+ t = (Text*)work->user1;
+ l = &t->l[t->front];
+ for(i=t->front; t->nwin>1 && (i = (i+1)%NL) != t->front; )
+ if(t->l[i].textfn != 0){
+ l = &t->l[i];
+ break;
+ }
+ current(l);
}else{
if(c==Kesc && typeesc>=0){
l->p0 = typeesc;
diff --git a/sys/src/cmd/samterm/samterm.h b/sys/src/cmd/samterm/samterm.h
index 75ff560ce..da8fea641 100644
--- a/sys/src/cmd/samterm/samterm.h
+++ b/sys/src/cmd/samterm/samterm.h
@@ -7,7 +7,9 @@
enum{
Up,
- Down
+ Down,
+
+ Kbel=0x7,
};
typedef struct Text Text;