I fixed this:

> +             word_separators =
> +                 options_get_string(&c->session, "word-separators");

Apart from that, looks fine, applied. Thanks!


On Fri, Nov 11, 2011 at 04:51:27PM -0500, Ben Boeckel wrote:
> On Mon, Oct 24, 2011 at 13:11:06 -0400, Ben Boeckel wrote:
> > On Sun, Oct 23, 2011 at 02:19:50 +0100, Nicholas Marriott wrote:
> > > I know we want an excuse to add client options but I'm not convinced
> > > this should be it - none of the mode options or key bindings or whatnot
> > > are per client and it seems confusing to have two word-separators
> > > options. Can't it use the existing session option?
> > 
> > It's currently a window option which is why I made it a client option.
> > Moving word-separators to being a session option altogether should
> > nicely solve the issue, however.
> 
> Patches attached to move it to being a session-option. For the release
> notes, this will break backwards compatability.
> 
> --Ben

> From ca148f16207691e216de26cc3602763acae4eff2 Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Fri, 11 Nov 2011 16:31:44 -0500
> Subject: [PATCH 1/9] Whitespace fixes
> 
> ---
>  trunk/compat/getopt.c |    2 +-
>  trunk/options-table.c |    5 ++---
>  trunk/tmux.h          |    4 ++--
>  3 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/trunk/compat/getopt.c b/trunk/compat/getopt.c
> index f6ecb58..b7b8582 100644
> --- a/trunk/compat/getopt.c
> +++ b/trunk/compat/getopt.c
> @@ -108,7 +108,7 @@ BSDgetopt(nargc, nargv, ostr)
>                                   __progname, BSDoptopt);
>                       return (BADCH);
>               }
> -             else                            /* white space */
> +             else                            /* white space */
>                       BSDoptarg = nargv[BSDoptind];
>               place = EMSG;
>               ++BSDoptind;
> diff --git a/trunk/options-table.c b/trunk/options-table.c
> index 1bdb0de..2b72fb6 100644
> --- a/trunk/options-table.c
> +++ b/trunk/options-table.c
> @@ -388,8 +388,8 @@ const struct options_table_entry session_options_table[] 
> = {
>       { .name = "terminal-overrides",
>         .type = OPTIONS_TABLE_STRING,
>         .default_str = "*88col*:colors=88,*256col*:colors=256"
> -                      ",xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007"
> -                      ":Cc=\\E]12;%p1%s\\007:Cr=\\E]112\\007"
> +                      ",xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007"
> +                      ":Cc=\\E]12;%p1%s\\007:Cr=\\E]112\\007"
>                        ":Cs=\\E[%p1%d q:Csr=\\E[2 q,screen*:XT"
>       },
>  
> @@ -397,7 +397,6 @@ const struct options_table_entry session_options_table[] 
> = {
>         .type = OPTIONS_TABLE_STRING,
>         .default_str = "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID "
>                        "SSH_CONNECTION WINDOWID XAUTHORITY"
> -
>       },
>  
>       { .name = "visual-activity",
> diff --git a/trunk/tmux.h b/trunk/tmux.h
> index 08650d5..514df8f 100644
> --- a/trunk/tmux.h
> +++ b/trunk/tmux.h
> @@ -843,7 +843,7 @@ RB_HEAD(window_pane_tree, window_pane);
>  struct window {
>       char            *name;
>       struct event     name_timer;
> -     struct timeval   silence_timer;
> +     struct timeval   silence_timer;
>  
>       struct window_pane *active;
>       struct window_pane *last;
> @@ -876,7 +876,7 @@ struct winlink {
>       struct grid_cell status_cell;
>       char            *status_text;
>  
> -     int              flags;
> +     int              flags;
>  #define WINLINK_BELL 0x1
>  #define WINLINK_ACTIVITY 0x2
>  #define WINLINK_CONTENT 0x4
> -- 
> 1.7.6.4
> 

> From 3d7857c61ffd1f9ab9aab36d16f693101829f1ad Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Fri, 11 Nov 2011 16:44:54 -0500
> Subject: [PATCH 2/9] Make word-separators a session option
> 
> ---
>  trunk/examples/tmux.vim |    4 ++--
>  trunk/options-table.c   |   10 +++++-----
>  trunk/tmux.1            |   15 +++++++--------
>  trunk/window-copy.c     |    6 +++---
>  4 files changed, 17 insertions(+), 18 deletions(-)
> 
> diff --git a/trunk/examples/tmux.vim b/trunk/examples/tmux.vim
> index ae24be7..e738d33 100644
> --- a/trunk/examples/tmux.vim
> +++ b/trunk/examples/tmux.vim
> @@ -61,7 +61,7 @@ syn keyword tmuxOptsSet mouse-select-pane message-limit 
> quiet escape-time
>  syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg
>  syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg
>  syn keyword tmuxOptsSet display-panes-active-colour alternate-screen
> -syn keyword tmuxOptsSet detach-on-destroy
> +syn keyword tmuxOptsSet detach-on-destroy word-separators
>  
>  syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width
>  syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg
> @@ -72,7 +72,7 @@ syn keyword tmuxOptsSetw main-pane-width main-pane-height 
> monitor-content
>  syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg
>  syn keyword tmuxOptsSetw window-status-current-fg mode-mouse 
> synchronize-panes
>  syn keyword tmuxOptsSetw window-status-format window-status-current-format
> -syn keyword tmuxOptsSetw word-separators window-status-alert-attr
> +syn keyword tmuxOptsSetw window-status-alert-attr
>  syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg
>  
>  syn keyword tmuxTodo FIXME NOTE TODO XXX contained
> diff --git a/trunk/options-table.c b/trunk/options-table.c
> index 2b72fb6..10c2d9a 100644
> --- a/trunk/options-table.c
> +++ b/trunk/options-table.c
> @@ -419,6 +419,11 @@ const struct options_table_entry session_options_table[] 
> = {
>         .default_num = 0
>       },
>  
> +     { .name = "word-separators",
> +       .type = OPTIONS_TABLE_STRING,
> +       .default_str = " -_@"
> +     },
> +
>       { .name = NULL }
>  };
>  
> @@ -613,11 +618,6 @@ const struct options_table_entry window_options_table[] 
> = {
>         .default_str = "#I:#W#F"
>       },
>  
> -     { .name = "word-separators",
> -       .type = OPTIONS_TABLE_STRING,
> -       .default_str = " -_@"
> -     },
> -
>       { .name = "xterm-keys",
>         .type = OPTIONS_TABLE_FLAG,
>         .default_num = 0
> diff --git a/trunk/tmux.1 b/trunk/tmux.1
> index 5817f0d..79fcb5b 100644
> --- a/trunk/tmux.1
> +++ b/trunk/tmux.1
> @@ -841,7 +841,7 @@ and
>  characters as word delimiters by default, but this can be adjusted by
>  setting the
>  .Em word-separators
> -window option.
> +session option.
>  Next word moves to the start of the next word, next word end to the end of 
> the
>  next word and previous word to the start of the previous word.
>  The three next and previous space keys work similarly but use a space alone 
> as
> @@ -2292,6 +2292,12 @@ window option is enabled.
>  If
>  .Ic monitor-silence
>  is enabled, prints a message after the interval has expired on a given 
> window.
> +.It Ic word-separators Ar string
> +Sets the session's conception of what characters are considered word
> +separators, for the purposes of the next and previous word commands in
> +copy mode.
> +The default is
> +.Ql \ -_@ .
>  .El
>  .It Xo Ic set-window-option
>  .Op Fl agu
> @@ -2532,13 +2538,6 @@ option for details of special character sequences 
> available.
>  The default is
>  .Ql #I:#W#F .
>  .Pp
> -.It Ic word-separators Ar string
> -Sets the window's conception of what characters are considered word
> -separators, for the purposes of the next and previous word commands in
> -copy mode.
> -The default is
> -.Ql \ -_@ .
> -.Pp
>  .It Xo Ic xterm-keys
>  .Op Ic on | off
>  .Xc
> diff --git a/trunk/window-copy.c b/trunk/window-copy.c
> index 2af2bf2..b41ca7e 100644
> --- a/trunk/window-copy.c
> +++ b/trunk/window-copy.c
> @@ -548,13 +548,13 @@ window_copy_key(struct window_pane *wp, struct session 
> *sess, int key)
>               break;
>       case MODEKEYCOPY_NEXTWORD:
>               word_separators =
> -                 options_get_string(&wp->window->options, "word-separators");
> +                 options_get_string(&sess->options, "word-separators");
>               for (; np != 0; np--)
>                       window_copy_cursor_next_word(wp, word_separators);
>               break;
>       case MODEKEYCOPY_NEXTWORDEND:
>               word_separators =
> -                 options_get_string(&wp->window->options, "word-separators");
> +                 options_get_string(&sess->options, "word-separators");
>               for (; np != 0; np--)
>                       window_copy_cursor_next_word_end(wp, word_separators);
>               break;
> @@ -564,7 +564,7 @@ window_copy_key(struct window_pane *wp, struct session 
> *sess, int key)
>               break;
>       case MODEKEYCOPY_PREVIOUSWORD:
>               word_separators =
> -                 options_get_string(&wp->window->options, "word-separators");
> +                 options_get_string(&sess->options, "word-separators");
>               for (; np != 0; np--)
>                       window_copy_cursor_previous_word(wp, word_separators);
>               break;
> -- 
> 1.7.6.4
> 

> From eed94e8730ef678357a5b64d4ff03fa607ae0a84 Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Thu, 20 Oct 2011 01:45:28 -0400
> Subject: [PATCH 3/9] Update commands and options for vim syntax
> 
> The vim syntax file has fallen behind and there are new commands and
> options since it has been updated last.
> ---
>  trunk/examples/tmux.vim |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/trunk/examples/tmux.vim b/trunk/examples/tmux.vim
> index e738d33..2b72176 100644
> --- a/trunk/examples/tmux.vim
> +++ b/trunk/examples/tmux.vim
> @@ -62,6 +62,8 @@ syn keyword tmuxOptsSet pane-active-border-bg 
> pane-active-border-fg
>  syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg
>  syn keyword tmuxOptsSet display-panes-active-colour alternate-screen
>  syn keyword tmuxOptsSet detach-on-destroy word-separators
> +syn keyword tmuxOptsSet destroy-unattached exit-unattached set-clipboard
> +syn keyword tmuxOptsSet bell-on-alert mouse-select-window mouse-utf8
>  
>  syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width
>  syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg
> @@ -74,6 +76,7 @@ syn keyword tmuxOptsSetw window-status-current-fg 
> mode-mouse synchronize-panes
>  syn keyword tmuxOptsSetw window-status-format window-status-current-format
>  syn keyword tmuxOptsSetw window-status-alert-attr
>  syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg
> +syn keyword tmuxOptsSetw pane-base-index other-pane-height other-pane-width
>  
>  syn keyword tmuxTodo FIXME NOTE TODO XXX contained
>  
> -- 
> 1.7.6.4
> 

> From 50486aa0d42e71a47c66db43abe1c01f10e43b5e Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Thu, 20 Oct 2011 01:47:23 -0400
> Subject: [PATCH 4/9] Add word-wise edit commands and bindings
> 
> This also adds bindings for vi and emacs key tables.
> 
> I don't use emacs, but I copied the commands from its copy bindings. Not
> sure if there's a NEXTWORD binding for emacs, but if there is, the copy
> key table is missing it as well.
> ---
>  trunk/mode-key.c |   23 +++++++++++++++++------
>  trunk/tmux.h     |    4 ++++
>  2 files changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/trunk/mode-key.c b/trunk/mode-key.c
> index 246426d..e45f1c6 100644
> --- a/trunk/mode-key.c
> +++ b/trunk/mode-key.c
> @@ -49,11 +49,15 @@ const struct mode_key_cmdstr mode_key_cmdstr_edit[] = {
>       { MODEKEYEDIT_DELETE, "delete" },
>       { MODEKEYEDIT_DELETELINE, "delete-line" },
>       { MODEKEYEDIT_DELETETOENDOFLINE, "delete-end-of-line" },
> +     { MODEKEYEDIT_DELETEWORD, "delete-word" },
>       { MODEKEYEDIT_ENDOFLINE, "end-of-line" },
>       { MODEKEYEDIT_ENTER, "enter" },
>       { MODEKEYEDIT_HISTORYDOWN, "history-down" },
>       { MODEKEYEDIT_HISTORYUP, "history-up" },
> +     { MODEKEYEDIT_NEXTWORD, "next-word" },
> +     { MODEKEYEDIT_NEXTWORDEND, "next-word-end" },
>       { MODEKEYEDIT_PASTE, "paste" },
> +     { MODEKEYEDIT_PREVIOUSWORD, "previous-word" },
>       { MODEKEYEDIT_STARTOFLINE, "start-of-line" },
>       { MODEKEYEDIT_SWITCHMODE, "switch-mode" },
>       { MODEKEYEDIT_SWITCHMODEAPPEND, "switch-mode-append" },
> @@ -127,7 +131,8 @@ const struct mode_key_entry mode_key_vi_edit[] = {
>       { '\003' /* C-c */,     0, MODEKEYEDIT_CANCEL },
>       { '\010' /* C-h */,     0, MODEKEYEDIT_BACKSPACE },
>       { '\011' /* Tab */,     0, MODEKEYEDIT_COMPLETE },
> -     { '\025' /* C-u */,     0, MODEKEYEDIT_DELETELINE },
> +     { '\025' /* C-u */,     0, MODEKEYEDIT_DELETELINE },
> +     { '\027' /* C-w */,     0, MODEKEYEDIT_DELETEWORD },
>       { '\033' /* Escape */,  0, MODEKEYEDIT_SWITCHMODE },
>       { '\r',                 0, MODEKEYEDIT_ENTER },
>       { KEYC_BSPACE,          0, MODEKEYEDIT_BACKSPACE },
> @@ -145,13 +150,16 @@ const struct mode_key_entry mode_key_vi_edit[] = {
>       { '\r',                 1, MODEKEYEDIT_ENTER },
>       { '^',                  1, MODEKEYEDIT_STARTOFLINE },
>       { 'a',                  1, MODEKEYEDIT_SWITCHMODEAPPEND },
> +     { 'b',                  1, MODEKEYEDIT_PREVIOUSWORD },
>       { 'd',                  1, MODEKEYEDIT_DELETELINE },
> +     { 'e',                  1, MODEKEYEDIT_NEXTWORDEND },
>       { 'h',                  1, MODEKEYEDIT_CURSORLEFT },
>       { 'i',                  1, MODEKEYEDIT_SWITCHMODE },
>       { 'j',                  1, MODEKEYEDIT_HISTORYDOWN },
>       { 'k',                  1, MODEKEYEDIT_HISTORYUP },
>       { 'l',                  1, MODEKEYEDIT_CURSORRIGHT },
>       { 'p',                  1, MODEKEYEDIT_PASTE },
> +     { 'w',                  1, MODEKEYEDIT_NEXTWORD },
>       { KEYC_BSPACE,          1, MODEKEYEDIT_BACKSPACE },
>       { KEYC_DC,              1, MODEKEYEDIT_DELETE },
>       { KEYC_DOWN,            1, MODEKEYEDIT_HISTORYDOWN },
> @@ -259,18 +267,21 @@ const struct mode_key_entry mode_key_emacs_edit[] = {
>       { '\002' /* C-b */,     0, MODEKEYEDIT_CURSORLEFT },
>       { '\003' /* C-c */,     0, MODEKEYEDIT_CANCEL },
>       { '\004' /* C-d */,     0, MODEKEYEDIT_DELETE },
> -     { '\005' /* C-e */,     0, MODEKEYEDIT_ENDOFLINE },
> +     { '\005' /* C-e */,     0, MODEKEYEDIT_ENDOFLINE },
>       { '\006' /* C-f */,     0, MODEKEYEDIT_CURSORRIGHT },
> -     { '\010' /* C-H */,     0, MODEKEYEDIT_BACKSPACE },
> -     { '\011' /* Tab */,     0, MODEKEYEDIT_COMPLETE },
> -     { '\013' /* C-k */,     0, MODEKEYEDIT_DELETETOENDOFLINE },
> +     { '\010' /* C-H */,     0, MODEKEYEDIT_BACKSPACE },
> +     { '\011' /* Tab */,     0, MODEKEYEDIT_COMPLETE },
> +     { '\013' /* C-k */,     0, MODEKEYEDIT_DELETETOENDOFLINE },
>       { '\016' /* C-n */,     0, MODEKEYEDIT_HISTORYDOWN },
>       { '\020' /* C-p */,     0, MODEKEYEDIT_HISTORYUP },
>       { '\024' /* C-t */,     0, MODEKEYEDIT_TRANSPOSECHARS },
> -     { '\025' /* C-u */,     0, MODEKEYEDIT_DELETELINE },
> +     { '\025' /* C-u */,     0, MODEKEYEDIT_DELETELINE },
> +     { '\027' /* C-w */,     0, MODEKEYEDIT_DELETEWORD },
>       { '\031' /* C-y */,     0, MODEKEYEDIT_PASTE },
>       { '\033' /* Escape */,  0, MODEKEYEDIT_CANCEL },
>       { '\r',                 0, MODEKEYEDIT_ENTER },
> +     { 'b' | KEYC_ESCAPE,    0, MODEKEYEDIT_PREVIOUSWORD },
> +     { 'f' | KEYC_ESCAPE,    0, MODEKEYEDIT_NEXTWORDEND },
>       { 'm' | KEYC_ESCAPE,    0, MODEKEYEDIT_STARTOFLINE },
>       { KEYC_BSPACE,          0, MODEKEYEDIT_BACKSPACE },
>       { KEYC_DC,              0, MODEKEYEDIT_DELETE },
> diff --git a/trunk/tmux.h b/trunk/tmux.h
> index 514df8f..d1898a2 100644
> --- a/trunk/tmux.h
> +++ b/trunk/tmux.h
> @@ -438,11 +438,15 @@ enum mode_key_cmd {
>       MODEKEYEDIT_DELETE,
>       MODEKEYEDIT_DELETELINE,
>       MODEKEYEDIT_DELETETOENDOFLINE,
> +     MODEKEYEDIT_DELETEWORD,
>       MODEKEYEDIT_ENDOFLINE,
>       MODEKEYEDIT_ENTER,
>       MODEKEYEDIT_HISTORYDOWN,
>       MODEKEYEDIT_HISTORYUP,
> +     MODEKEYEDIT_NEXTWORD,
> +     MODEKEYEDIT_NEXTWORDEND,
>       MODEKEYEDIT_PASTE,
> +     MODEKEYEDIT_PREVIOUSWORD,
>       MODEKEYEDIT_STARTOFLINE,
>       MODEKEYEDIT_SWITCHMODE,
>       MODEKEYEDIT_SWITCHMODEAPPEND,
> -- 
> 1.7.6.4
> 

> From 50a09295f7ba2bc7eb1e9d60593cb5188da1f3e4 Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Thu, 20 Oct 2011 02:17:49 -0400
> Subject: [PATCH 5/9] Implement delete-word editing action
> 
> ---
>  trunk/status.c |   33 ++++++++++++++++++++++++++++++---
>  1 files changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/trunk/status.c b/trunk/status.c
> index 5db40b4..4d88c5c 100644
> --- a/trunk/status.c
> +++ b/trunk/status.c
> @@ -970,9 +970,10 @@ status_prompt_redraw(struct client *c)
>  void
>  status_prompt_key(struct client *c, int key)
>  {
> +     const char              *word_separators;
>       struct paste_buffer     *pb;
> -     char                    *s, *first, *last, word[64], swapc;
> -     const char              *histstr;
> +     char                    *s, *first, *last, word[64], swapc;
> +     const char              *histstr;
>       u_char                   ch;
>       size_t                   size, n, off, idx;
>  
> @@ -1089,11 +1090,37 @@ status_prompt_key(struct client *c, int key)
>                       c->flags |= CLIENT_STATUS;
>               }
>               break;
> +     case MODEKEYEDIT_DELETEWORD:
> +             word_separators =
> +                 options_get_string(&c->session, "word-separators");
> +             idx = c->prompt_index;
> +             /* Find a non-separator. */
> +             while (idx != 0) {
> +                     idx--;
> +                     if (!strchr(word_separators, c->prompt_buffer[idx]))
> +                             break;
> +             }
> +             /* Find the separator at the beginning of the word. */
> +             while (idx != 0) {
> +                     idx--;
> +                     if (strchr(word_separators, c->prompt_buffer[idx])) {
> +                             /* Go back to the word. */
> +                             idx++;
> +                             break;
> +                     }
> +             }
> +             memmove(c->prompt_buffer + idx,
> +                 c->prompt_buffer + c->prompt_index,
> +                 size + 1 - c->prompt_index);
> +             memset(c->prompt_buffer + size - (c->prompt_index - idx), '\0', 
> c->prompt_index - idx);
> +             c->prompt_index = idx;
> +             c->flags |= CLIENT_STATUS;
> +             break;
>       case MODEKEYEDIT_HISTORYUP:
>               histstr = status_prompt_up_history(&c->prompt_hindex);
>               if (histstr == NULL)
>                       break;
> -             xfree(c->prompt_buffer);
> +             xfree(c->prompt_buffer);
>               c->prompt_buffer = xstrdup(histstr);
>               c->prompt_index = strlen(c->prompt_buffer);
>               c->flags |= CLIENT_STATUS;
> -- 
> 1.7.6.4
> 

> From a7e9ade442b49ac4b95d9be2ae19aed0ebf3d2ae Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Thu, 20 Oct 2011 02:24:18 -0400
> Subject: [PATCH 6/9] Implement the previous-word edit action
> 
> ---
>  trunk/status.c |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/trunk/status.c b/trunk/status.c
> index 4d88c5c..814b207 100644
> --- a/trunk/status.c
> +++ b/trunk/status.c
> @@ -1116,6 +1116,26 @@ status_prompt_key(struct client *c, int key)
>               c->prompt_index = idx;
>               c->flags |= CLIENT_STATUS;
>               break;
> +     case MODEKEYEDIT_PREVIOUSWORD:
> +             word_separators =
> +                 options_get_string(&c->session, "word-separators");
> +             /* Find a non-separator. */
> +             while (c->prompt_index != 0) {
> +                     c->prompt_index--;
> +                     if (!strchr(word_separators, 
> c->prompt_buffer[c->prompt_index]))
> +                             break;
> +             }
> +             /* Find the separator at the beginning of the word. */
> +             while (c->prompt_index != 0) {
> +                     c->prompt_index--;
> +                     if (strchr(word_separators, 
> c->prompt_buffer[c->prompt_index])) {
> +                             /* Go back to the word. */
> +                             c->prompt_index++;
> +                             break;
> +                     }
> +             }
> +             c->flags |= CLIENT_STATUS;
> +             break;
>       case MODEKEYEDIT_HISTORYUP:
>               histstr = status_prompt_up_history(&c->prompt_hindex);
>               if (histstr == NULL)
> -- 
> 1.7.6.4
> 

> From 5c7090c5525c5765c19aa877d010896eb690ae9e Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Thu, 20 Oct 2011 02:24:44 -0400
> Subject: [PATCH 7/9] Implement the next-word-end edit action
> 
> ---
>  trunk/status.c |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/trunk/status.c b/trunk/status.c
> index 814b207..253a87e 100644
> --- a/trunk/status.c
> +++ b/trunk/status.c
> @@ -1116,6 +1116,26 @@ status_prompt_key(struct client *c, int key)
>               c->prompt_index = idx;
>               c->flags |= CLIENT_STATUS;
>               break;
> +     case MODEKEYEDIT_NEXTWORDEND:
> +             word_separators =
> +                 options_get_string(&c->session, "word-separators");
> +             /* Find a word. */
> +             while (c->prompt_index != size) {
> +                     c->prompt_index++;
> +                     if (!strchr(word_separators, 
> c->prompt_buffer[c->prompt_index]))
> +                             break;
> +             }
> +             /* Find the separator at the end of the word. */
> +             while (c->prompt_index != size) {
> +                     c->prompt_index++;
> +                     if (strchr(word_separators, 
> c->prompt_buffer[c->prompt_index])) {
> +                             /* Go back to the word. */
> +                             c->prompt_index--;
> +                             break;
> +                     }
> +             }
> +             c->flags |= CLIENT_STATUS;
> +             break;
>       case MODEKEYEDIT_PREVIOUSWORD:
>               word_separators =
>                   options_get_string(&c->session, "word-separators");
> -- 
> 1.7.6.4
> 

> From cec863a40bf9c1f65c84d2dcc095d05494617293 Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Thu, 20 Oct 2011 02:24:56 -0400
> Subject: [PATCH 8/9] Implement the next-word edit action
> 
> ---
>  trunk/status.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/trunk/status.c b/trunk/status.c
> index 253a87e..23f39d1 100644
> --- a/trunk/status.c
> +++ b/trunk/status.c
> @@ -1116,6 +1116,23 @@ status_prompt_key(struct client *c, int key)
>               c->prompt_index = idx;
>               c->flags |= CLIENT_STATUS;
>               break;
> +     case MODEKEYEDIT_NEXTWORD:
> +             word_separators =
> +                 options_get_string(&c->session, "word-separators");
> +             /* Find a separator. */
> +             while (c->prompt_index != size) {
> +                     c->prompt_index++;
> +                     if (strchr(word_separators, 
> c->prompt_buffer[c->prompt_index]))
> +                             break;
> +             }
> +             /* Find the word right after the separation. */
> +             while (c->prompt_index != size) {
> +                     c->prompt_index++;
> +                     if (!strchr(word_separators, 
> c->prompt_buffer[c->prompt_index]))
> +                             break;
> +             }
> +             c->flags |= CLIENT_STATUS;
> +             break;
>       case MODEKEYEDIT_NEXTWORDEND:
>               word_separators =
>                   options_get_string(&c->session, "word-separators");
> -- 
> 1.7.6.4
> 

> From 7449008115c81cd9eb24a32df66006891589dc16 Mon Sep 17 00:00:00 2001
> From: Ben Boeckel <maths...@gmail.com>
> Date: Thu, 20 Oct 2011 02:25:18 -0400
> Subject: [PATCH 9/9] Cross word motions off the TODO list
> 
> ---
>  trunk/TODO |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/trunk/TODO b/trunk/TODO
> index 1aedf5c..5d6aac7 100644
> --- a/trunk/TODO
> +++ b/trunk/TODO
> @@ -6,7 +6,6 @@
>  - flags to centre screen in window
>  - activity/bell should be per-window not per-link? what if it is cur win in
>    session not being watched?
> -- next prev word etc in command prompt
>  - use a better termcap internally instead of screen, perhaps xterm
>  - should be able to move to a hidden pane and it would be moved into view. 
> pane
>    number in status line/top-right would be cool for this
> -- 
> 1.7.6.4
> 




------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to