mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 22:43:58 +00:00
Support UTF-8 with choose-buffer, from Kosuke ASAMI. Also make
buffer_sample bigger to let it trim at window right edge.
This commit is contained in:
@ -49,6 +49,7 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
char *action, *action_data;
|
||||
const char *template;
|
||||
u_int idx;
|
||||
int utf8flag;
|
||||
|
||||
if ((c = cmd_current_client(cmdq)) == NULL) {
|
||||
cmdq_error(cmdq, "no client available");
|
||||
@ -60,6 +61,7 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
|
||||
if ((wl = cmd_find_window(cmdq, args_get(args, 't'), NULL)) == NULL)
|
||||
return (CMD_RETURN_ERROR);
|
||||
utf8flag = options_get_number(&wl->window->options, "utf8");
|
||||
|
||||
if (paste_get_top(&global_buffers) == NULL)
|
||||
return (CMD_RETURN_NORMAL);
|
||||
@ -79,7 +81,7 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
|
||||
cdata->ft_template = xstrdup(template);
|
||||
format_add(cdata->ft, "line", "%u", idx - 1);
|
||||
format_paste_buffer(cdata->ft, pb);
|
||||
format_paste_buffer(cdata->ft, pb, utf8flag);
|
||||
|
||||
xasprintf(&action_data, "%u", idx - 1);
|
||||
cdata->command = cmd_template_replace(action, action_data, 1);
|
||||
|
Reference in New Issue
Block a user