Makes sense thanks. But your fix still wraps in some cases, can't spot
why immediately probably due to broken EOL tracking where _down moves
the cursor to the end. How about this instead?

Index: window-copy.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/window-copy.c,v
retrieving revision 1.93
diff -u -p -r1.93 window-copy.c
--- window-copy.c       5 Jul 2013 14:44:06 -0000       1.93
+++ window-copy.c       5 Jul 2013 16:42:50 -0000
@@ -1622,10 +1622,13 @@ void
 window_copy_cursor_left(struct window_pane *wp)
 {
        struct window_copy_mode_data    *data = wp->modedata;
+       struct screen                   *s = data->backing;
 
        if (data->cx == 0) {
-               window_copy_cursor_up(wp, 0);
-               window_copy_cursor_end_of_line(wp);
+               if (data->oy != screen_hsize(s)) {
+                       window_copy_cursor_up(wp, 0);
+                       window_copy_cursor_end_of_line(wp);
+               }
        } else {
                window_copy_update_cursor(wp, data->cx - 1, data->cy);
                if (window_copy_update_selection(wp))
@@ -1637,18 +1640,20 @@ void
 window_copy_cursor_right(struct window_pane *wp)
 {
        struct window_copy_mode_data    *data = wp->modedata;
+       struct screen                   *s = data->backing;
        u_int                            px, py;
 
+       py = screen_hsize(s) + data->cy - data->oy;
        if (data->screen.sel.flag && data->rectflag)
                px = screen_size_x(&data->screen);
-       else {
-               py = screen_hsize(data->backing) + data->cy - data->oy;
+       else
                px = window_copy_find_length(wp, py);
-       }
 
        if (data->cx >= px) {
-               window_copy_cursor_start_of_line(wp);
-               window_copy_cursor_down(wp, 0);
+               if (py < screen_hsize(s) + screen_size_y(s) - 1) {
+                       window_copy_cursor_down(wp, 0);
+                       window_copy_cursor_start_of_line(wp);
+               }
        } else {
                window_copy_update_cursor(wp, data->cx + 1, data->cy);
                if (window_copy_update_selection(wp))




On Fri, Jul 05, 2013 at 12:17:28PM -0400, Ben Boeckel wrote:
> On Fri, Jul 05, 2013 at 16:56:33 +0100, Nicholas Marriott wrote:
> > Hi. What's the behaviour here before and after?
> 
> Before, if you went "left" from the top-left corner was the top-right
> corner since (cy = = max(0, cy - 1); cx = end_of_line(cy);) was done.
> Something similar for the "right" of bottom-right being bottom-left. The
> new behavior is that nothing is "left" of the top-left nor "right" of
> bottom-right.
> 
> --Ben

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to