since we can't add half a two-column character to converted in
display_string(), and we need the other to keep the "$" from spilling
over to the next line if the line contains two-column characters in the
right places)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2232
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
size_t index;
/* Current position in converted. */
+ /* If dollars is TRUE, make room for the "$" at the end of the
+ * line. */
+ if (dollars && len > 0 && strlenpt(buf) > start_col + len)
+ len--;
+
if (len == 0)
return mallocstrcpy(NULL, "");
}
#ifdef NANO_WIDE
else if (wcwidth((wchar_t)wide_buf) > 1) {
- index++;
- if (dollars && column == start_col)
- index++;
+ converted[index++] = ' ';
start_col++;
start_index += wide_buf_len;