diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-04-23 11:26:11 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-04-23 11:26:11 +0100 |
commit | 953c3ef47a1933d38308075c1bacc7ea8d38301b (patch) | |
tree | 6484bdd51ecedbb5888717db271c151257ec87f5 /window-copy.c | |
parent | 12e9c974fadc5ed6f0e7db10c40d5a0d55e0da8a (diff) | |
parent | 64613b9d411a7c76a50a2f9c66df345f082fce25 (diff) | |
download | rtmux-953c3ef47a1933d38308075c1bacc7ea8d38301b.tar.gz rtmux-953c3ef47a1933d38308075c1bacc7ea8d38301b.tar.bz2 rtmux-953c3ef47a1933d38308075c1bacc7ea8d38301b.zip |
Merge branch 'obsd-master'
Conflicts:
Makefile
tmux.1
window.c
Diffstat (limited to 'window-copy.c')
-rw-r--r-- | window-copy.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/window-copy.c b/window-copy.c index 9aaf554c..afa6d4d1 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1194,8 +1194,8 @@ window_copy_write_line( screen_write_puts(ctx, &gc, "%s", hdr); } else if (py == last && data->inputtype != WINDOW_COPY_OFF) { limit = sizeof hdr; - if (limit > screen_size_x(s)) - limit = screen_size_x(s); + if (limit > screen_size_x(s) + 1) + limit = screen_size_x(s) + 1; if (data->inputtype == WINDOW_COPY_NUMERICPREFIX) { xoff = size = xsnprintf(hdr, limit, "Repeat: %u", data->numprefix); @@ -1208,10 +1208,12 @@ window_copy_write_line( } else size = 0; - screen_write_cursormove(ctx, xoff, py); - screen_write_copy(ctx, data->backing, xoff, - (screen_hsize(data->backing) - data->oy) + py, - screen_size_x(s) - size, 1); + if (size < screen_size_x(s)) { + screen_write_cursormove(ctx, xoff, py); + screen_write_copy(ctx, data->backing, xoff, + (screen_hsize(data->backing) - data->oy) + py, + screen_size_x(s) - size, 1); + } if (py == data->cy && data->cx == screen_size_x(s)) { memcpy(&gc, &grid_default_cell, sizeof gc); @@ -2031,7 +2033,8 @@ window_copy_cursor_next_word(struct window_pane *wp, const char *separators) } void -window_copy_cursor_next_word_end(struct window_pane *wp, const char *separators) +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; @@ -2082,7 +2085,8 @@ window_copy_cursor_next_word_end(struct window_pane *wp, const char *separators) /* Move to the previous place where a word begins. */ void -window_copy_cursor_previous_word(struct window_pane *wp, const char *separators) +window_copy_cursor_previous_word(struct window_pane *wp, + const char *separators) { struct window_copy_mode_data *data = wp->modedata; u_int px, py; |