mirror of
https://github.com/tmux/tmux.git
synced 2024-11-18 10:28:54 +00:00
Simplify copy lines, from Keith Amling.
This commit is contained in:
parent
53cbae544f
commit
58c97695c9
@ -1442,17 +1442,10 @@ window_copy_get_selection(struct window_pane *wp, size_t *len)
|
||||
}
|
||||
|
||||
/* Copy the lines. */
|
||||
if (sy == ey)
|
||||
window_copy_copy_line(wp, &buf, &off, sy, firstsx, lastex);
|
||||
else {
|
||||
window_copy_copy_line(wp, &buf, &off, sy, firstsx, restex);
|
||||
if (ey - sy > 1) {
|
||||
for (i = sy + 1; i < ey; i++) {
|
||||
window_copy_copy_line(
|
||||
wp, &buf, &off, i, restsx, restex);
|
||||
}
|
||||
}
|
||||
window_copy_copy_line(wp, &buf, &off, ey, restsx, lastex);
|
||||
for (i = sy; i <= ey; i++) {
|
||||
window_copy_copy_line(wp, &buf, &off, i,
|
||||
(i == sy ? firstsx : restsx),
|
||||
(i == ey ? lastex : restex));
|
||||
}
|
||||
|
||||
/* Don't bother if no data. */
|
||||
|
Loading…
Reference in New Issue
Block a user