When scrolling by page or half-page, vim moves to the first
non-whitespace character of a line. Emulate the behavior in copy mode.
---
window-copy.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/window-copy.c b/window-copy.c
index ee6a2e8..17808b8 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -458,6 +458,7 @@ window_copy_key(struct window_pane *wp, struct session
*sess, int key)
case MODEKEYCOPY_PREVIOUSPAGE:
for (; np != 0; np--)
window_copy_pageup(wp);
+ window_copy_cursor_back_to_indentation(wp);
break;
case MODEKEYCOPY_NEXTPAGE:
n = 1;
@@ -471,6 +472,7 @@ window_copy_key(struct window_pane *wp, struct session
*sess, int key)
}
window_copy_update_selection(wp);
window_copy_redraw_screen(wp);
+ window_copy_cursor_back_to_indentation(wp);
break;
case MODEKEYCOPY_HALFPAGEUP:
n = screen_size_y(s) / 2;
@@ -482,6 +484,7 @@ window_copy_key(struct window_pane *wp, struct session
*sess, int key)
}
window_copy_update_selection(wp);
window_copy_redraw_screen(wp);
+ window_copy_cursor_back_to_indentation(wp);
break;
case MODEKEYCOPY_HALFPAGEDOWN:
n = screen_size_y(s) / 2;
@@ -493,6 +496,7 @@ window_copy_key(struct window_pane *wp, struct session
*sess, int key)
}
window_copy_update_selection(wp);
window_copy_redraw_screen(wp);
+ window_copy_cursor_back_to_indentation(wp);
break;
case MODEKEYCOPY_TOPLINE:
data->cx = 0;
--
1.8.2.1
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
tmux-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users