version 1.135, 2015/10/23 16:02:21 |
version 1.136, 2015/10/27 15:58:43 |
|
|
s = &data->screen; |
s = &data->screen; |
screen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0); |
screen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0); |
|
|
keys = options_get_number(&wp->window->options, "mode-keys"); |
keys = options_get_number(wp->window->options, "mode-keys"); |
if (keys == MODEKEY_EMACS) |
if (keys == MODEKEY_EMACS) |
mode_key_init(&data->mdata, &mode_key_tree_emacs_copy); |
mode_key_init(&data->mdata, &mode_key_tree_emacs_copy); |
else |
else |
|
|
if (backing == &wp->base) |
if (backing == &wp->base) |
return; |
return; |
|
|
utf8flag = options_get_number(&wp->window->options, "utf8"); |
utf8flag = options_get_number(wp->window->options, "utf8"); |
memcpy(&gc, &grid_default_cell, sizeof gc); |
memcpy(&gc, &grid_default_cell, sizeof gc); |
|
|
old_hsize = screen_hsize(data->backing); |
old_hsize = screen_hsize(data->backing); |
|
|
break; |
break; |
case MODEKEYCOPY_NEXTWORD: |
case MODEKEYCOPY_NEXTWORD: |
word_separators = |
word_separators = |
options_get_string(&sess->options, "word-separators"); |
options_get_string(sess->options, "word-separators"); |
for (; np != 0; np--) |
for (; np != 0; np--) |
window_copy_cursor_next_word(wp, word_separators); |
window_copy_cursor_next_word(wp, word_separators); |
break; |
break; |
case MODEKEYCOPY_NEXTWORDEND: |
case MODEKEYCOPY_NEXTWORDEND: |
word_separators = |
word_separators = |
options_get_string(&sess->options, "word-separators"); |
options_get_string(sess->options, "word-separators"); |
for (; np != 0; np--) |
for (; np != 0; np--) |
window_copy_cursor_next_word_end(wp, word_separators); |
window_copy_cursor_next_word_end(wp, word_separators); |
break; |
break; |
|
|
break; |
break; |
case MODEKEYCOPY_PREVIOUSWORD: |
case MODEKEYCOPY_PREVIOUSWORD: |
word_separators = |
word_separators = |
options_get_string(&sess->options, "word-separators"); |
options_get_string(sess->options, "word-separators"); |
for (; np != 0; np--) |
for (; np != 0; np--) |
window_copy_cursor_previous_word(wp, word_separators); |
window_copy_cursor_previous_word(wp, word_separators); |
break; |
break; |
|
|
return; |
return; |
|
|
input_on: |
input_on: |
keys = options_get_number(&wp->window->options, "mode-keys"); |
keys = options_get_number(wp->window->options, "mode-keys"); |
if (keys == MODEKEY_EMACS) |
if (keys == MODEKEY_EMACS) |
mode_key_init(&data->mdata, &mode_key_tree_emacs_edit); |
mode_key_init(&data->mdata, &mode_key_tree_emacs_edit); |
else |
else |
|
|
return; |
return; |
|
|
input_off: |
input_off: |
keys = options_get_number(&wp->window->options, "mode-keys"); |
keys = options_get_number(wp->window->options, "mode-keys"); |
if (keys == MODEKEY_EMACS) |
if (keys == MODEKEY_EMACS) |
mode_key_init(&data->mdata, &mode_key_tree_emacs_copy); |
mode_key_init(&data->mdata, &mode_key_tree_emacs_copy); |
else |
else |
|
|
|
|
if (*searchstr == '\0') |
if (*searchstr == '\0') |
return; |
return; |
utf8flag = options_get_number(&wp->window->options, "utf8"); |
utf8flag = options_get_number(wp->window->options, "utf8"); |
wrapflag = options_get_number(&wp->window->options, "wrap-search"); |
wrapflag = options_get_number(wp->window->options, "wrap-search"); |
searchlen = screen_write_strlen(utf8flag, "%s", searchstr); |
searchlen = screen_write_strlen(utf8flag, "%s", searchstr); |
|
|
screen_init(&ss, searchlen, 1, 0); |
screen_init(&ss, searchlen, 1, 0); |
|
|
|
|
if (*searchstr == '\0') |
if (*searchstr == '\0') |
return; |
return; |
utf8flag = options_get_number(&wp->window->options, "utf8"); |
utf8flag = options_get_number(wp->window->options, "utf8"); |
wrapflag = options_get_number(&wp->window->options, "wrap-search"); |
wrapflag = options_get_number(wp->window->options, "wrap-search"); |
searchlen = screen_write_strlen(utf8flag, "%s", searchstr); |
searchlen = screen_write_strlen(utf8flag, "%s", searchstr); |
|
|
screen_init(&ss, searchlen, 1, 0); |
screen_init(&ss, searchlen, 1, 0); |
|
|
{ |
{ |
struct window_copy_mode_data *data = wp->modedata; |
struct window_copy_mode_data *data = wp->modedata; |
struct screen *s = &data->screen; |
struct screen *s = &data->screen; |
struct options *oo = &wp->window->options; |
struct options *oo = wp->window->options; |
struct grid_cell gc; |
struct grid_cell gc; |
char hdr[512]; |
char hdr[512]; |
size_t last, xoff = 0, size = 0, limit; |
size_t last, xoff = 0, size = 0, limit; |
|
|
{ |
{ |
struct window_copy_mode_data *data = wp->modedata; |
struct window_copy_mode_data *data = wp->modedata; |
struct screen *s = &data->screen; |
struct screen *s = &data->screen; |
struct options *oo = &wp->window->options; |
struct options *oo = wp->window->options; |
struct grid_cell gc; |
struct grid_cell gc; |
u_int sx, sy, ty, cy; |
u_int sx, sy, ty, cy; |
|
|
|
|
* bottom-right-most, regardless of copy direction. If it is vi, also |
* bottom-right-most, regardless of copy direction. If it is vi, also |
* keep bottom-right-most character. |
* keep bottom-right-most character. |
*/ |
*/ |
keys = options_get_number(&wp->window->options, "mode-keys"); |
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 |
|
|
{ |
{ |
struct screen_write_ctx ctx; |
struct screen_write_ctx ctx; |
|
|
if (options_get_number(&global_options, "set-clipboard")) { |
if (options_get_number(global_options, "set-clipboard")) { |
screen_write_start(&ctx, wp, NULL); |
screen_write_start(&ctx, wp, NULL); |
screen_write_setselection(&ctx, buf, len); |
screen_write_setselection(&ctx, buf, len); |
screen_write_stop(&ctx); |
screen_write_stop(&ctx); |
|
|
if (buf == NULL) |
if (buf == NULL) |
return; |
return; |
|
|
if (options_get_number(&global_options, "set-clipboard")) { |
if (options_get_number(global_options, "set-clipboard")) { |
screen_write_start(&ctx, wp, NULL); |
screen_write_start(&ctx, wp, NULL); |
screen_write_setselection(&ctx, buf, len); |
screen_write_setselection(&ctx, buf, len); |
screen_write_stop(&ctx); |
screen_write_stop(&ctx); |
|
|
const char *separators) |
const char *separators) |
{ |
{ |
struct window_copy_mode_data *data = wp->modedata; |
struct window_copy_mode_data *data = wp->modedata; |
struct options *oo = &wp->window->options; |
struct options *oo = wp->window->options; |
struct screen *back_s = data->backing; |
struct screen *back_s = data->backing; |
u_int px, py, xx, yy; |
u_int px, py, xx, yy; |
int keys, expected = 1; |
int keys, expected = 1; |