From a458871cdec00b92889e7047611b288c4ebb9432 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 27 Feb 2013 00:00:00 -0600 Subject: [PATCH] top: make user's choice for insert/overtype persistent When true line input editing with paste capability was was re-introduced in the commit below, the concept for the distinct insert/overtype mode was also introduced. But such a distinction did not survive an key. With this commit, the cursor state is made persistent. (everything is perfectly justified plus right margins) (are completely filled, but of course it must be luck) Reference(s): commit 477b10c0bd00ed8750c02a9580e606baadb0e6f4 Signed-off-by: Jim Warner --- top/top.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/top/top.c b/top/top.c index ad0d00ef..1e1d749d 100644 --- a/top/top.c +++ b/top/top.c @@ -1086,7 +1086,8 @@ static char *ioline (const char *prompt) { #define phyCOL (beg+pos+1) #define bufMAX ((int)sizeof(buf)-2) // -1 for '\0' string delimeter static char buf[MEDBUFSIZ+1]; // +1 for '\0' string delimeter - int beg, pos, len, key, ovt, i; + static int ovt; + int beg, pos, len, key, i; struct lin_s { struct lin_s *bkw; // ptr to older saved strs struct lin_s *fwd; // ptr to newer saved strs @@ -1099,10 +1100,10 @@ static char *ioline (const char *prompt) { anchor->str = alloc_s(""); // top-of-stack == empty str } plin = anchor; - pos = ovt = 0; + pos = 0; beg = show_pmt(prompt); memset(buf, '\0', sizeof(buf)); - putp(Cap_curs_norm); + putp(ovt ? Cap_curs_huge : Cap_curs_norm); do { fflush(stdout);