aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/samterm
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2017-10-23 10:18:27 +0200
committerPetter Rodhelind <petter.rodhelind@gmail.com>2017-10-23 10:18:27 +0200
commited9a25d9020b6b46f235760956f98bc37abb26d1 (patch)
treea1b801cf00aa112180bb2fcaf877996ab9f2a79c /src/cmd/samterm
parentb31034d39354b59ce2a48503d41d9290b6a611b7 (diff)
downloadplan9port-ed9a25d9020b6b46f235760956f98bc37abb26d1.tar.gz
plan9port-ed9a25d9020b6b46f235760956f98bc37abb26d1.tar.bz2
plan9port-ed9a25d9020b6b46f235760956f98bc37abb26d1.zip
samterm: Add undo/redo key bindings.
Diffstat (limited to 'src/cmd/samterm')
-rw-r--r--src/cmd/samterm/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/samterm/main.c b/src/cmd/samterm/main.c
index 726cba2d..adeffeed 100644
--- a/src/cmd/samterm/main.c
+++ b/src/cmd/samterm/main.c
@@ -539,6 +539,8 @@ sendcmd(char *c, int n, Text *t) {
#define CUT (Kcmd+'x')
#define COPY (Kcmd+'c')
#define PASTE (Kcmd+'v')
+#define UNDO (Kcmd+'z')
+#define REDO (Kcmd+'Z')
int
nontypingkey(int c)
@@ -670,6 +672,10 @@ type(Flayer *l, int res) /* what a bloody mess this is */
for(l=t->l; l<&t->l[NL]; l++)
if(l->textfn)
flsetselect(l, l->p0, l->p1);
+ }else if(c == UNDO) {
+ sendcmd("u", 1, t);
+ }else if(c == REDO) {
+ sendcmd("u-1", 3, t);
}else if(backspacing && !hostlock){
/* backspacing immediately after outcmd(): sorry */
if(l->f.p0>0 && a>0){