From c8f7f331f226d39cd0df6404f0ca240c5f7ff57e Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 18 Nov 2004 05:24:36 +0000
Subject: [PATCH] Don't unnecessarily call puttext() in showbuf() input loop.
 Solves problem of not being able to select help text in Win32 conio
 implementation.

---
 src/uifc/uifc32.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c
index 0feff6a022..5a7c98f897 100644
--- a/src/uifc/uifc32.c
+++ b/src/uifc/uifc32.c
@@ -1944,6 +1944,7 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
 	char inverse=0,high=0;
 	char *textbuf;
     char *p;
+	char *oldp=NULL;
 	int i,j,k,len;
 	int	 lines;
 	int pad=1;
@@ -2122,7 +2123,10 @@ void showbuf(int mode, int left, int top, int width, int height, char *title, ch
 	}
 	else {
 		while(i==0) {
-			puttext(left+1+pad,top+2+pad,left+width-2-pad,top+height-1-pad,p);
+			if(p!=oldp) {
+				puttext(left+1+pad,top+2+pad,left+width-2-pad,top+height-1-pad,p);
+				oldp=p;
+			}
 			if(kbwait()) {
 				j=inkey();
 				if(j==CIO_KEY_MOUSE) {
-- 
GitLab