changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: Make ctrl+g focus text windows and cycle zeroxed copies (thanks kvik)

changeset 7418: a1b2824f596e
parent 7417: 278bf2c57889
child 7419: 0712b88b437b
author: Ori Bernstein <ori@eigenstate.org>
date: Mon, 21 Oct 2019 15:29:07 -0700
files: sys/man/1/sam sys/src/cmd/samterm/main.c sys/src/cmd/samterm/samterm.h
description: Make ctrl+g focus text windows and cycle zeroxed copies (thanks kvik)
     1.1--- a/sys/man/1/sam
     1.2+++ b/sys/man/1/sam
     1.3@@ -723,6 +723,9 @@ since the last mouse button hit.
     1.4 .PP
     1.5 Ctrl+b switches to the command window and moves to the end
     1.6 of the text.
     1.7+Ctrl+g switches from to the last focused window.
     1.8+If the focused window is a text window, ctrl+g switches
     1.9+to the next zeroxed instance of that window.
    1.10 .PP
    1.11 The button 3 menu controls window operations.
    1.12 The top of the menu
     2.1--- a/sys/src/cmd/samterm/main.c
     2.2+++ b/sys/src/cmd/samterm/main.c
     2.3@@ -485,6 +485,7 @@ nontypingkey(int c)
     2.4 	case Ksoh:
     2.5 	case Kenq:
     2.6 	case Kstx:
     2.7+	case Kbel:
     2.8 		return 1;
     2.9 	}
    2.10 	return 0;
    2.11@@ -658,6 +659,22 @@ type(Flayer *l, int res)	/* what a blood
    2.12 		a = t->rasp.nrunes;
    2.13 		flsetselect(l, a, a);
    2.14 		center(l, a);
    2.15+ 	}else if(c == Kbel){
    2.16+ 		int i;
    2.17+ 		if(work == nil)
    2.18+ 			return;
    2.19+ 		if(which != work){
    2.20+ 			current(work);
    2.21+ 			return;
    2.22+ 		}
    2.23+ 		t = (Text*)work->user1;
    2.24+ 		l = &t->l[t->front];
    2.25+ 		for(i=t->front; t->nwin>1 && (i = (i+1)%NL) != t->front; )
    2.26+ 			if(t->l[i].textfn != 0){
    2.27+ 				l = &t->l[i];
    2.28+ 				break;
    2.29+ 			}
    2.30+ 		current(l);
    2.31 	}else{
    2.32 		if(c==Kesc && typeesc>=0){
    2.33 			l->p0 = typeesc;
     3.1--- a/sys/src/cmd/samterm/samterm.h
     3.2+++ b/sys/src/cmd/samterm/samterm.h
     3.3@@ -7,7 +7,9 @@
     3.4 
     3.5 enum{
     3.6 	Up,
     3.7-	Down
     3.8+	Down,
     3.9+
    3.10+	Kbel=0x7,
    3.11 };
    3.12 
    3.13 typedef struct Text	Text;