version 1.106, 2014/04/17 14:45:49 |
version 1.107, 2014/04/24 09:14:43 |
|
|
*data->inputstr = '\0'; |
*data->inputstr = '\0'; |
break; |
break; |
case MODEKEYEDIT_PASTE: |
case MODEKEYEDIT_PASTE: |
if ((pb = paste_get_top(&global_buffers)) == NULL) |
if ((pb = paste_get_top()) == NULL) |
break; |
break; |
for (n = 0; n < pb->size; n++) { |
for (n = 0; n < pb->size; n++) { |
ch = (u_char) pb->data[n]; |
ch = (u_char) pb->data[n]; |
|
|
|
|
if (idx == -1) { |
if (idx == -1) { |
limit = options_get_number(&global_options, "buffer-limit"); |
limit = options_get_number(&global_options, "buffer-limit"); |
paste_add(&global_buffers, buf, len, limit); |
paste_add(buf, len, limit); |
} else if (paste_replace(&global_buffers, idx, buf, len) != 0) |
} else if (paste_replace(idx, buf, len) != 0) |
free(buf); |
free(buf); |
} |
} |
|
|
|
|
if (idx == -1) |
if (idx == -1) |
idx = 0; |
idx = 0; |
|
|
if (idx == 0 && paste_get_top(&global_buffers) == NULL) { |
if (idx == 0 && paste_get_top() == NULL) { |
limit = options_get_number(&global_options, "buffer-limit"); |
limit = options_get_number(&global_options, "buffer-limit"); |
paste_add(&global_buffers, buf, len, limit); |
paste_add(buf, len, limit); |
return; |
return; |
} |
} |
|
|
pb = paste_get_index(&global_buffers, idx); |
pb = paste_get_index(idx); |
if (pb != NULL) { |
if (pb != NULL) { |
buf = xrealloc(buf, 1, len + pb->size); |
buf = xrealloc(buf, 1, len + pb->size); |
memmove(buf + pb->size, buf, len); |
memmove(buf + pb->size, buf, len); |
|
|
len += pb->size; |
len += pb->size; |
} |
} |
|
|
if (paste_replace(&global_buffers, idx, buf, len) != 0) |
if (paste_replace(idx, buf, len) != 0) |
free(buf); |
free(buf); |
} |
} |
|
|