mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 09:43:13 +02:00
core: improve and fix bugs on standard paste and bracketed paste
Changes: - wait control sequence for end of bracketed paste (and only after, check if we should ask confirmation to user) - add option weechat.look.paste_bracketed_timer_delay to force the end of bracketed paste if the control sequence for end of bracketed paste was not received in time - in bracketed paste mode, with paste_max_lines=1, do not ask confirmation for one line (ask for one line only if paste_max_lines=0) - fix bugs with mintty: bracketed paste should be ok every time (even if some codes are sometimes partially received, WeeChat will now handle that properly); the standard paste often fails (due to bug in mintty, which sends paste very slowly to remote app); so the bracketed paste mode is highly recommended with mintty - after paste in bracketed paste mode, the undo key (ctrl+"_" by default) will undo whole paste, not chars one by one
This commit is contained in:
@@ -2394,7 +2394,9 @@ COMMAND_CALLBACK(input)
|
||||
else if (string_strcasecmp (argv[1], "redo") == 0)
|
||||
gui_input_redo (buffer);
|
||||
else if (string_strcasecmp (argv[1], "paste_start") == 0)
|
||||
gui_key_paste_bracketed_start ();
|
||||
{
|
||||
/* do nothing here */
|
||||
}
|
||||
else if (string_strcasecmp (argv[1], "paste_stop") == 0)
|
||||
{
|
||||
/* do nothing here */
|
||||
|
||||
@@ -126,6 +126,7 @@ struct t_config_option *config_look_mouse_timer_delay;
|
||||
struct t_config_option *config_look_nickmode;
|
||||
struct t_config_option *config_look_nickmode_empty;
|
||||
struct t_config_option *config_look_paste_bracketed;
|
||||
struct t_config_option *config_look_paste_bracketed_timer_delay;
|
||||
struct t_config_option *config_look_paste_max_lines;
|
||||
struct t_config_option *config_look_prefix[GUI_CHAT_NUM_PREFIXES];
|
||||
struct t_config_option *config_look_prefix_align;
|
||||
@@ -1981,12 +1982,19 @@ config_weechat_init_options ()
|
||||
"text from typed-in text (\"ESC[200~\", followed by the pasted text, "
|
||||
"followed by \"ESC[201~\")"),
|
||||
NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_paste_bracketed, NULL, NULL, NULL);
|
||||
config_look_paste_bracketed_timer_delay = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"paste_bracketed_timer_delay", "integer",
|
||||
N_("force end of bracketed paste after this delay (in seconds) if the "
|
||||
"control sequence for end of bracketed paste (\"ESC[201~\") was not "
|
||||
"received in time"),
|
||||
NULL, 1, 60, "10", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
config_look_paste_max_lines = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"paste_max_lines", "integer",
|
||||
N_("max number of lines for paste without asking user "
|
||||
"(-1 = disable this feature)"),
|
||||
NULL, -1, INT_MAX, "3", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
NULL, -1, INT_MAX, "1", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"prefix_error", "string",
|
||||
|
||||
@@ -150,6 +150,7 @@ extern struct t_config_option *config_look_mouse_timer_delay;
|
||||
extern struct t_config_option *config_look_nickmode;
|
||||
extern struct t_config_option *config_look_nickmode_empty;
|
||||
extern struct t_config_option *config_look_paste_bracketed;
|
||||
extern struct t_config_option *config_look_paste_bracketed_timer_delay;
|
||||
extern struct t_config_option *config_look_paste_max_lines;
|
||||
extern struct t_config_option *config_look_prefix[];
|
||||
extern struct t_config_option *config_look_prefix_align;
|
||||
|
||||
Reference in New Issue
Block a user