mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Bug 867: Don't consume KBD_MOD_PASTE to enter insert mode.
In the previous version, the first event that had KBD_MOD_PASTE entered insert mode and was consumed for that; ELinks then inserted the characters from the remaining events. Now, to make ELinks insert the first character too, I'm changing things so that KBD_MOD_PASTE does not cause insert mode to be entered; instead, ELinks inserts those characters regardless of whether insert mode is on.
This commit is contained in:
parent
d79edd5954
commit
64102db7ae
@ -1395,7 +1395,8 @@ field_op(struct session *ses, struct document_view *doc_view,
|
|||||||
if_assert_failed return FRAME_EVENT_OK;
|
if_assert_failed return FRAME_EVENT_OK;
|
||||||
|
|
||||||
if (fc->mode == FORM_MODE_DISABLED || ev->ev != EVENT_KBD
|
if (fc->mode == FORM_MODE_DISABLED || ev->ev != EVENT_KBD
|
||||||
|| ses->insert_mode == INSERT_MODE_OFF)
|
|| (ses->insert_mode == INSERT_MODE_OFF
|
||||||
|
&& !(get_kbd_modifier(ev) & KBD_MOD_PASTE)))
|
||||||
return FRAME_EVENT_IGNORED;
|
return FRAME_EVENT_IGNORED;
|
||||||
|
|
||||||
action_id = kbd_action(KEYMAP_EDIT, ev, NULL);
|
action_id = kbd_action(KEYMAP_EDIT, ev, NULL);
|
||||||
|
@ -1065,9 +1065,7 @@ try_form_insert_mode(struct session *ses, struct document_view *doc_view,
|
|||||||
action_id = kbd_action(KEYMAP_EDIT, ev, NULL);
|
action_id = kbd_action(KEYMAP_EDIT, ev, NULL);
|
||||||
|
|
||||||
if (ses->insert_mode == INSERT_MODE_OFF) {
|
if (ses->insert_mode == INSERT_MODE_OFF) {
|
||||||
if (action_id == ACT_EDIT_ENTER
|
if (action_id == ACT_EDIT_ENTER) {
|
||||||
|| (action_id == -1
|
|
||||||
&& check_kbd_modifier(ev, KBD_MOD_PASTE))) {
|
|
||||||
ses->insert_mode = INSERT_MODE_ON;
|
ses->insert_mode = INSERT_MODE_ON;
|
||||||
status = FRAME_EVENT_REFRESH;
|
status = FRAME_EVENT_REFRESH;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user