diff options
author | 2010-06-05 15:49:48 +0000 | |
---|---|---|
committer | 2010-06-05 15:49:48 +0000 | |
commit | 45eb06dfbd20a7b5991d9026f8ad6c96f701f2a8 (patch) | |
tree | 1a5285bb670e3e2f9b54f38d6d1f53b4c532f915 | |
parent | Minimize changes against the ber.c in snmpd and ypldap. This also fixes an (diff) | |
download | wireguard-openbsd-45eb06dfbd20a7b5991d9026f8ad6c96f701f2a8.tar.xz wireguard-openbsd-45eb06dfbd20a7b5991d9026f8ad6c96f701f2a8.zip |
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.
-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); |