diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-06-05 15:49:49 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-06-05 15:49:49 +0000 |
commit | 068355f3fa5971dffc446b364b34bcc337c3620f (patch) | |
tree | 077a7da9de6b4750802944a6ba4fe49220cb09ad /usr.bin/tmux | |
parent | 96e07753dd53cb419227a1e21f577e0001de1540 (diff) |
Make start-of-line work the same as end-of-line on wrapped lines (jump
to real start if at edge of screen). By Micah Cowan.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/window-copy.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index 91718bdf243..0d1c66ca951 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.57 2010/05/31 19:51:29 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.58 2010/06/05 15:49:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1427,7 +1427,17 @@ void window_copy_cursor_start_of_line(struct window_pane *wp) { struct window_copy_mode_data *data = wp->modedata; + struct screen *back_s = data->backing; + struct grid *gd = back_s->grid; + u_int py; + if (data->cx == 0) { + py = screen_hsize(back_s) + data->cy - data->oy; + while (py > 0 && gd->linedata[py-1].flags & GRID_LINE_WRAPPED) { + window_copy_cursor_up(wp, 0); + py = screen_hsize(back_s) + data->cy - data->oy; + } + } window_copy_update_cursor(wp, 0, data->cy); if (window_copy_update_selection(wp)) window_copy_redraw_lines(wp, data->cy, 1); |