On Wed, Jul 10, 2013 at 10:22:45AM +0100, Nicholas Marriott wrote:
> It is a typo, try this:

Hmm... the behavior I notice, with this change, doesn't quite
mimic what one is used to from vi.

With this patch, say I do the following:

        $ ls
        IMG_0586.PNG    yoyo.txt

I enter 'copy mode' (prefix-[).
I press 'k' to go up one line.
 . The cursor ends up at the end of the line (after yoyo.txt)
I press '0' to go to the start of the line.
I press 'e' to move to the right.
 . The cursor stops on the 1st letter 'G' of "IMG_0586.PNG".
 ! In vi it stops on the number '6' of the same file.
 # In an older snapshot's tmux, it stops at the '_' of same file.
I press 'e' again, to further move to the right.
 . Nothing happens.
 ! In vi the cursor stops on the '.' of "IMG_0586.PNG" file.
 # the cursor stops on the space after the "IMG_0586.PNG" file.

I'm not sure what the intended behavior was/is, but this is not
what I would say is desirable.

Am I missing something?

--patrick


> 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     10 Jul 2013 09:21:31 -0000
> @@ -1929,7 +1929,7 @@ window_copy_cursor_next_word_end(struct 
>       } while (expected == 0);
>  
>       /* Back up to the end-of-word like vi. */
> -     if (options_get_number(oo, "status-keys") == MODEKEY_VI && px != 0)
> +     if (options_get_number(oo, "mode-keys") == MODEKEY_VI && px != 0)
>               px--;
>  
>       window_copy_update_cursor(wp, px, data->cy);
> 
> 
> 
> On Tue, Jul 09, 2013 at 07:58:49PM -0700, patrick keshishian wrote:
> > Hi,
> > 
> > This is on:
> > 
> > $ sysctl kern.version
> > kern.version=OpenBSD 5.3-current (GENERIC.MP) #18: Sat Jul  6 16:54:29 MDT 
> > 2013
> >     [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > 
> > I don't know if this is a typo or not, but the tiny change
> > makes "things better"(tm): Using the global session options
> > vs that of the window pane one.
> > 
> > The code I followed does this without the chagne:
> > 
> >   /* paraphrased */
> >   window_copy_key(...)
> >   windoe_copy_cursor_next_word_end(...)
> >   options_get_number(oo=<addr>, name="status-keys") {
> >       /* stuff */
> >       oo = &wp->window->options;
> > 
> >       if ((o = option_find(oo=<addr>, name="status-keys")) == NULL)
> >         fatalx("missing options")
> >    }
> > 
> > 
> > If the change is not correct, hopefully there is enough hint
> > in this post to help fix the issue correctly.
> > 
> > cheers,
> > --patrick
> > 
> > 
> > Index: window-copy.c
> > ===================================================================
> > RCS file: /cvs/obsd/src/usr.bin/tmux/window-copy.c,v
> > retrieving revision 1.93
> > diff -u -p -u -p -r1.93 window-copy.c
> > --- window-copy.c   5 Jul 2013 14:44:06 -0000       1.93
> > +++ window-copy.c   10 Jul 2013 02:46:04 -0000
> > @@ -1894,7 +1894,7 @@ void
> >  window_copy_cursor_next_word_end(struct window_pane *wp, const char 
> > *separators)
> >  {
> >     struct window_copy_mode_data    *data = wp->modedata;
> > -   struct options                  *oo = &wp->window->options;
> > +   struct options                  *oo = &global_s_options;
> >     struct screen                   *back_s = data->backing;
> >     u_int                            px, py, xx, yy;
> >     int                              expected = 1;
> > 
> 

Reply via email to