mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Support bracketed paste mode of xterm in mcedit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
8f35c90b94
commit
5b47861101
@ -3457,14 +3457,14 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
|
||||
if (option_auto_para_formatting)
|
||||
{
|
||||
edit_double_newline (edit);
|
||||
if (option_return_does_auto_indent)
|
||||
if (option_return_does_auto_indent && !bracketed_pasting_in_progress)
|
||||
edit_auto_indent (edit);
|
||||
format_paragraph (edit, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
edit_insert (edit, '\n');
|
||||
if (option_return_does_auto_indent)
|
||||
if (option_return_does_auto_indent && !bracketed_pasting_in_progress)
|
||||
edit_auto_indent (edit);
|
||||
}
|
||||
break;
|
||||
|
@ -1065,6 +1065,15 @@ edit_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
|
||||
ret = edit_dialog_command_execute (h, command);
|
||||
}
|
||||
|
||||
/*
|
||||
* Due to the "end of bracket" escape the editor sees input with is_idle() == false
|
||||
* (expects more characters) and hence doesn't yet refresh the screen, but then
|
||||
* no further characters arrive (there's only an "end of bracket" which is swallowed
|
||||
* by tty_get_event()), so you end up with a screen that's not refreshed after pasting.
|
||||
* So let's trigger an IDLE signal.
|
||||
*/
|
||||
if (!is_idle ())
|
||||
widget_want_idle (w, TRUE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1080,6 +1089,11 @@ edit_dialog_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, v
|
||||
edit_dlg_deinit ();
|
||||
return MSG_HANDLED;
|
||||
|
||||
case MSG_IDLE:
|
||||
widget_want_idle (w, FALSE);
|
||||
edit_update_screen ((WEdit *) h->current->data);
|
||||
return MSG_HANDLED;
|
||||
|
||||
default:
|
||||
return dlg_default_callback (w, sender, msg, parm, data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user