From afe4ea4250073e482c6ec6accfc539f873df6977 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 16 Jun 2020 07:28:57 +0000 Subject: [PATCH] Correctly move to previous line when looking for previous word, from Derry Jing. --- window-copy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/window-copy.c b/window-copy.c index f30d241e..7b7ab72c 100644 --- a/window-copy.c +++ b/window-copy.c @@ -4535,14 +4535,14 @@ window_copy_cursor_previous_word_pos(struct window_mode_entry *wme, separators)) break; } else { - if (data->cy == 0 && + if (py == 0 || + (data->cy == 0 && (screen_hsize(data->backing) == 0 || data->oy >= - screen_hsize(data->backing) - 1)) + screen_hsize(data->backing) - 1))) goto out; - py = screen_hsize(data->backing) + data->cy - - data->oy; + py--; px = window_copy_find_length(wme, py); /* Stop if separator at EOL. */