From 930b1d7809ad9837439884759b60915acb150134 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 5 Jan 2005 05:22:42 +0000
Subject: [PATCH] remove DB's hacks to work around problems with ncurses'
 display of two-column characters at the beginnings and ends of long lines
 (i.e, lines with $'s added), as the problems don't occur with ncurses 5.4,
 and there's no easy way to fix the same type of problem with doing a regex
 replace of "^" on a line beginning with a two-column character

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2231 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 src/winio.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/winio.c b/src/winio.c
index 2f1962b4..6fd93d3e 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2273,12 +2273,6 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
     size_t index;
 	/* Current position in converted. */
 
-    /* If dollars is TRUE, make room for the "$" at the end of the
-     * line.  Also make sure that we don't try to display only part of a
-     * multicolumn character there. */
-    if (dollars && len > 0 && strlenpt(buf) > start_col + len)
-	len--;
-
     if (len == 0)
 	return mallocstrcpy(NULL, "");
 
@@ -2293,7 +2287,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
     index = 0;
 
     if (column < start_col || (dollars && column > 0 &&
-		buf[start_index] != '\t')) {
+	buf[start_index] != '\t')) {
 	int wide_buf, wide_buf_len;
 
 	/* We don't display all of buf[start_index] since it starts to
@@ -2347,15 +2341,9 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
 	}
 #ifdef NANO_WIDE
 	else if (wcwidth((wchar_t)wide_buf) > 1) {
-	    /* If dollars is TRUE, make room for the "$" at the
-	     * beginning of the line.  Also make sure that we don't try
-	     * to display only part of a multicolumn character there. */
-	    converted[0] = ' ';
-	    index = 1;
-	    if (dollars && column == start_col) {
-		converted[1] = ' ';
-		index = 2;
-	    }
+	    index++;
+	    if (dollars && column == start_col)
+		index++;
 
 	    start_col++;
 	    start_index += wide_buf_len;
-- 
GitLab