diff --git a/sys/man/1/sam b/sys/man/1/sam index f9e9afdac..1651cbd72 100644 --- a/sys/man/1/sam +++ b/sys/man/1/sam @@ -723,6 +723,9 @@ since the last mouse button hit. .PP Ctrl+b switches to the command window and moves to the end of the text. +Ctrl+g switches from to the last focused window. +If the focused window is a text window, ctrl+g switches +to the next zeroxed instance of that window. .PP The button 3 menu controls window operations. The top of the menu 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;