Revision: 2745
http://tmux.svn.sourceforge.net/tmux/?rev=2745&view=rev
Author: tcunha
Date: 2012-03-18 02:12:24 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
Sync OpenBSD patchset 1066:
Add a wrap-search option to turn off wrapping of searches in copy
mode. From Jacobo de Vera.
Modified Paths:
--------------
trunk/options-table.c
trunk/tmux.1
trunk/window-copy.c
Modified: trunk/options-table.c
===================================================================
--- trunk/options-table.c 2012-03-18 02:11:27 UTC (rev 2744)
+++ trunk/options-table.c 2012-03-18 02:12:24 UTC (rev 2745)
@@ -668,6 +668,11 @@
.default_str = "#I:#W#F"
},
+ { .name = "wrap-search",
+ .type = OPTIONS_TABLE_FLAG,
+ .default_num = 1
+ },
+
{ .name = "xterm-keys",
.type = OPTIONS_TABLE_FLAG,
.default_num = 0
Modified: trunk/tmux.1
===================================================================
--- trunk/tmux.1 2012-03-18 02:11:27 UTC (rev 2744)
+++ trunk/tmux.1 2012-03-18 02:12:24 UTC (rev 2745)
@@ -2665,6 +2665,12 @@
function key sequences; these have a number included to indicate modifiers such
as Shift, Alt or Ctrl.
The default is off.
+.Pp
+.It Xo Ic wrap-search
+.Op Ic on | off
+.Xc
+If this option is set, searches will wrap around the end of the pane contents.
+The default is on.
.El
.It Xo Ic show-options
.Op Fl gsw
Modified: trunk/window-copy.c
===================================================================
--- trunk/window-copy.c 2012-03-18 02:11:27 UTC (rev 2744)
+++ trunk/window-copy.c 2012-03-18 02:12:24 UTC (rev 2745)
@@ -984,11 +984,12 @@
struct grid_cell gc;
size_t searchlen;
u_int i, last, fx, fy, px;
- int utf8flag, n, wrapped;
+ int utf8flag, n, wrapped, wrapflag;
if (*searchstr == '\0')
return;
utf8flag = options_get_number(&wp->window->options, "utf8");
+ wrapflag = options_get_number(&wp->window->options, "wrap-search");
searchlen = screen_write_strlen(utf8flag, "%s", searchstr);
screen_init(&ss, searchlen, 1, 0);
@@ -1021,7 +1022,7 @@
break;
}
}
- if (!n && !wrapped) {
+ if (wrapflag && !n && !wrapped) {
fx = gd->sx - 1;
fy = gd->hsize + gd->sy - 1;
wrapped = 1;
@@ -1041,11 +1042,12 @@
struct grid_cell gc;
size_t searchlen;
u_int i, first, fx, fy, px;
- int utf8flag, n, wrapped;
+ int utf8flag, n, wrapped, wrapflag;
if (*searchstr == '\0')
return;
utf8flag = options_get_number(&wp->window->options, "utf8");
+ wrapflag = options_get_number(&wp->window->options, "wrap-search");
searchlen = screen_write_strlen(utf8flag, "%s", searchstr);
screen_init(&ss, searchlen, 1, 0);
@@ -1078,7 +1080,7 @@
break;
}
}
- if (!n && !wrapped) {
+ if (wrapflag && !n && !wrapped) {
fx = 0;
fy = 0;
wrapped = 1;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs