From 35afab5eba6de8fc0dd1b9f3efea30604822e309 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sun, 13 Sep 2009 04:50:44 +0000 Subject: [PATCH] 2009-09-12 Chris Allegretta * winio.c (edit_update) - properly update edittop when using soft wrapping. Fixes lack of centering for searching for off-screen answers, found by Hannes . git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4409 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 5 +++++ src/winio.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92e42dee..597aa5e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-12 Chris Allegretta + * winio.c (edit_update) - properly update edittop when using soft wrapping. + Fixes lack of centering for searching for off-screen answers, found by + Hannes . + 2009-09-03 Chris Allegretta * global.c (shortcut_init): Fix up/down keys not responding in the file browser, discovered by Hannes . diff --git a/src/winio.c b/src/winio.c index 8c60c062..ed299020 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3245,9 +3245,11 @@ void edit_update(update_type location) goal = editwinrows - 1; } - for (; goal > 0 && foo->prev != NULL; goal--) + for (; goal > 0 && foo->prev != NULL; goal--) { + if (ISSET(SOFTWRAP)) + goal -= strlenpt(foo->data) / (COLS - 1); foo = foo->prev; - + } openfile->edittop = foo; }