summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/window-copy.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index 0b15007665b..83f68865b25 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.299 2020/06/11 19:43:34 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.300 2020/06/16 07:28:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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. */