version 1.68, 2011/04/19 21:31:33 |
version 1.69, 2011/04/24 21:06:12 |
|
|
size_t off; |
size_t off; |
u_int i, xx, yy, sx, sy, ex, ey, limit; |
u_int i, xx, yy, sx, sy, ex, ey, limit; |
u_int firstsx, lastex, restex, restsx; |
u_int firstsx, lastex, restex, restsx; |
|
int keys; |
|
|
if (!s->sel.flag) |
if (!s->sel.flag) |
return; |
return; |
|
|
* end (restex) of all other lines. |
* end (restex) of all other lines. |
*/ |
*/ |
xx = screen_size_x(s); |
xx = screen_size_x(s); |
|
|
|
/* |
|
* Behave according to mode-keys. If it is emacs, copy like emacs, |
|
* keeping the top-left-most character, and dropping the |
|
* bottom-right-most, regardless of copy direction. If it is vi, also |
|
* keep bottom-right-most character. |
|
*/ |
|
keys = options_get_number(&wp->window->options, "mode-keys"); |
if (data->rectflag) { |
if (data->rectflag) { |
/* |
/* |
* Need to ignore the column with the cursor in it, which for |
* Need to ignore the column with the cursor in it, which for |
|
|
*/ |
*/ |
if (data->selx < data->cx) { |
if (data->selx < data->cx) { |
/* Selection start is on the left. */ |
/* Selection start is on the left. */ |
lastex = data->cx; |
if (keys == MODEKEY_EMACS) { |
restex = data->cx; |
lastex = data->cx; |
|
restex = data->cx; |
|
} |
|
else { |
|
lastex = data->cx + 1; |
|
restex = data->cx + 1; |
|
} |
firstsx = data->selx; |
firstsx = data->selx; |
restsx = data->selx; |
restsx = data->selx; |
} else { |
} else { |
|
|
restsx = data->cx; |
restsx = data->cx; |
} |
} |
} else { |
} else { |
/* |
if (keys == MODEKEY_EMACS) |
* Like emacs, keep the top-left-most character, and drop the |
lastex = ex; |
* bottom-right-most, regardless of copy direction. |
else |
*/ |
lastex = ex + 1; |
lastex = ex; |
|
restex = xx; |
restex = xx; |
firstsx = sx; |
firstsx = sx; |
restsx = 0; |
restsx = 0; |