+2009-08-19 Chris Allegretta <chrisa@asty.org>
+ * Fix issue with soft wrapping not displaying the last character of each line,
+ fixed bug discovered by Hannes <mr_creosote@mutantwatch.de>.
+
2009-08-17 Mike Frysinger <vapier@gentoo.org>
* doc/syntax/(gentoo|sh|tcl).nanorc: Fix problems with empty regexes on POSIX.
Fixes Savannah bug 27175.
openfile->current_y = 0;
filestruct *tmp;
for (tmp = openfile->edittop; tmp != openfile->current; tmp = tmp->next)
- openfile->current_y += 1 + strlenpt(tmp->data) / COLS;
+ openfile->current_y += 1 + strlenpt(tmp->data) / (COLS - 1);
- openfile->current_y += xplustabs() / COLS;
+ openfile->current_y += xplustabs() / (COLS - 1);
if (openfile->current_y < editwinrows)
- wmove(edit, openfile->current_y, xpt % COLS);
+ wmove(edit, openfile->current_y, xpt % (COLS - 1));
} else {
openfile->current_y = openfile->current->lineno -
openfile->edittop->lineno;
mvwaddch(edit, line, COLS - 1, '$');
} else {
int full_length = strlenpt(fileptr->data);
- for (index += COLS; index < full_length && line < editwinrows; index += COLS) {
+ for (index += COLS - 1; index < full_length && line < editwinrows; index += COLS - 1) {
line++;
#ifdef DEBUG
fprintf(stderr, "update_line(): Softwrap code, moving to %d\n", line);