diff options
author | nicm <nicm> | 2019-12-11 18:30:29 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-12-11 18:30:29 +0000 |
commit | 64fb7e472a9e627ee486707ab9d30b607d76478a (patch) | |
tree | 06dbeb770f8cd01d9814cc7ce3d972a0029296f2 /window-copy.c | |
parent | ab630f72ed7a076a3e49b6649a49f9d8764a861c (diff) | |
download | rtmux-64fb7e472a9e627ee486707ab9d30b607d76478a.tar.gz rtmux-64fb7e472a9e627ee486707ab9d30b607d76478a.tar.bz2 rtmux-64fb7e472a9e627ee486707ab9d30b607d76478a.zip |
Tweak previous to check the wrapped flag and stop if not set.
Diffstat (limited to 'window-copy.c')
-rw-r--r-- | window-copy.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/window-copy.c b/window-copy.c index 32e254b5..4787fb27 100644 --- a/window-copy.c +++ b/window-copy.c @@ -2082,8 +2082,9 @@ static int window_copy_search_lr(struct grid *gd, struct grid *sgd, u_int *ppx, u_int py, u_int first, u_int last, int cis) { - u_int ax, bx, px, pywrap, endline; - int matched; + u_int ax, bx, px, pywrap, endline; + int matched; + struct grid_line *gl; endline = gd->hsize + gd->sy - 1; for (ax = first; ax < last; ax++) { @@ -2092,6 +2093,9 @@ window_copy_search_lr(struct grid *gd, pywrap = py; /* Wrap line. */ while (px >= gd->sx && pywrap < endline) { + gl = grid_get_line(gd, pywrap); + if (~gl->flags & GRID_LINE_WRAPPED) + break; px -= gd->sx; pywrap++; } @@ -2115,8 +2119,9 @@ static int window_copy_search_rl(struct grid *gd, struct grid *sgd, u_int *ppx, u_int py, u_int first, u_int last, int cis) { - u_int ax, bx, px, pywrap, endline; - int matched; + u_int ax, bx, px, pywrap, endline; + int matched; + struct grid_line *gl; endline = gd->hsize + gd->sy - 1; for (ax = last; ax > first; ax--) { @@ -2125,6 +2130,9 @@ window_copy_search_rl(struct grid *gd, pywrap = py; /* Wrap line. */ while (px >= gd->sx && pywrap < endline) { + gl = grid_get_line(gd, pywrap); + if (~gl->flags & GRID_LINE_WRAPPED) + break; px -= gd->sx; pywrap++; } |