From 24349c52b4fc930d183cf4ec4d7f4b6275e7cb0d Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 4 Aug 2013 06:45:58 +0200 Subject: [PATCH] rio: add ^B control sequence to move cursor to output point --- sys/include/keyboard.h | 2 ++ sys/man/1/rio | 3 ++- sys/src/cmd/rio/wind.c | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/include/keyboard.h b/sys/include/keyboard.h index c3aff395d..a9539a1a3 100644 --- a/sys/include/keyboard.h +++ b/sys/include/keyboard.h @@ -45,6 +45,8 @@ enum { Kscrollonedown= KF|0x21, Ksoh= 0x01, + Kstx= 0x02, + Ketx= 0x03, Keof= 0x04, Kenq= 0x05, Kack= 0x06, diff --git a/sys/man/1/rio b/sys/man/1/rio index bf225bf13..4426d15ef 100644 --- a/sys/man/1/rio +++ b/sys/man/1/rio @@ -391,7 +391,8 @@ for the preceding string (see .PP Typing a left or right arrow moves the cursor one character in that direction. Typing an SOH character (control-A) moves the cursor to the beginning of the -current line; an ENQ character (control-E) moves to the end. +current line; an ENQ character (control-E) moves to the end. The STX character +(control-B) moves the cursor to the output point. .PP Text may be moved vertically within the window. A scroll bar on the left of the window shows in its clear portion what fragment of the diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index d8c47d4cb..fc9a1176d 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -691,6 +691,10 @@ wkeyctl(Window *w, Rune r) wsetselect(w, q0, q0); wshow(w, w->q0); return; + case Kstx: /* ^B: output point */ + wsetselect(w, w->qh, w->qh); + wshow(w, w->q0); + return; } if(w->rawing && (w->q0==w->nr || w->mouseopen)){ waddraw(w, &r, 1);