From 7a57b3e237f84baebdcad15608b15850a7ee8068 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 6 Dec 1983 20:56:06 -0800 Subject: [PATCH] 'cursormodes' command added SCCS-vsn: usr.bin/window/lcmd.c 3.8 SCCS-vsn: usr.bin/window/lcmd1.c 3.10 --- usr/src/usr.bin/window/lcmd.c | 7 +++++-- usr/src/usr.bin/window/lcmd1.c | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/usr/src/usr.bin/window/lcmd.c b/usr/src/usr.bin/window/lcmd.c index af8517faf3..ce74dd301a 100644 --- a/usr/src/usr.bin/window/lcmd.c +++ b/usr/src/usr.bin/window/lcmd.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)lcmd.c 3.7 83/11/22"; +static char *sccsid = "@(#)lcmd.c 3.8 83/12/06"; #endif #include "defs.h" @@ -8,6 +8,7 @@ static char *sccsid = "@(#)lcmd.c 3.7 83/11/22"; int l_buffer(); int l_close(); +int l_cursormodes(); int l_escape(); int l_label(); int l_select(); @@ -18,6 +19,7 @@ int l_write(); struct lcmd_arg arg_buffer[]; struct lcmd_arg arg_close[]; +struct lcmd_arg arg_cursormodes[]; struct lcmd_arg arg_escape[]; struct lcmd_arg arg_label[]; struct lcmd_arg arg_select[]; @@ -29,7 +31,8 @@ struct lcmd_arg arg_write[]; struct lcmd_tab lcmd_tab[] = { "%", 1, l_select, arg_select, "buffer", 1, l_buffer, arg_buffer, - "close", 1, l_close, arg_close, + "close", 2, l_close, arg_close, + "cursormodes", 2, l_cursormodes, arg_cursormodes, "escape", 1, l_escape, arg_escape, "label", 1, l_label, arg_label, "select", 2, l_select, arg_select, diff --git a/usr/src/usr.bin/window/lcmd1.c b/usr/src/usr.bin/window/lcmd1.c index 5ad685c4a1..9767745336 100644 --- a/usr/src/usr.bin/window/lcmd1.c +++ b/usr/src/usr.bin/window/lcmd1.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)lcmd1.c 3.9 83/11/30"; +static char *sccsid = "@(#)lcmd1.c 3.10 83/12/06"; #endif #include "defs.h" @@ -35,7 +35,7 @@ register struct value *v; if (openwin(id, row, col, nrow, ncol, nline, label) == 0) return; v->v_type = V_NUM; - v->v_num = id; + v->v_num = id + 1; } struct lcmd_arg arg_buffer[] = { @@ -63,7 +63,7 @@ struct value *v; struct ww *w; v->v_type = V_NUM; - v->v_num = selwin ? selwin->ww_id : -1; + v->v_num = selwin ? selwin->ww_id + 1 : -1; if (arg_select[0].arg_vtype == V_ERR) return; if ((w = vtowin(&arg_select[0].arg_val)) == 0) @@ -181,6 +181,22 @@ struct value *v; c_close(w); } +struct lcmd_arg arg_cursormodes[] = { + { "modes", 1, ARG_NUM }, + { 0, 0, 0 } +}; + +l_cursormodes(v) +register struct value *v; +{ + register struct lcmd_arg *a = arg_cursormodes; + + v->v_type = V_NUM; + v->v_num = wwcursormodes; + if (a->arg_vtype != V_ERR) + wwsetcursormodes(a->arg_num); +} + struct ww * vtowin(v) register struct value *v; -- 2.20.1