From e08b312f5faacafdabe6fa35324a459d54b02cf4 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Fri, 17 Mar 2017 09:42:01 -0500 Subject: [PATCH 2/2] tweaks: avoid calling xplustabs() twice on the same location In do_up() and do_down(), was_column stores the value of xplustabs(), but then, if we're in softwrap mode, leftedge uses the value of xplustabs() too, both in the same location. Save processing time by making leftedge use was_column instead. --- src/move.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/move.c b/src/move.c index 6e5fd97..49b6ae9 100644 --- a/src/move.c +++ b/src/move.c @@ -484,7 +484,7 @@ void do_up(bool scroll_only) #ifndef NANO_TINY if (ISSET(SOFTWRAP)) { - leftedge = (xplustabs() / editwincols) * editwincols; + leftedge = (was_column / editwincols) * editwincols; target_column = openfile->placewewant % editwincols; } #endif @@ -535,7 +535,7 @@ void do_down(bool scroll_only) #ifndef NANO_TINY if (ISSET(SOFTWRAP)) { - leftedge = (xplustabs() / editwincols) * editwincols; + leftedge = (was_column / editwincols) * editwincols; target_column = openfile->placewewant % editwincols; } #endif -- 2.9.0