zed/crates/vim/test_data
Conrad Irwin 2e23527e09
Refactor key dispatch (#14942)
Simplify key dispatch code.

Previously we would maintain a cache of key matchers for each context
that
would store the pending input. For the last while we've also stored the
typed prefix on the window. This is redundant, we only need one copy, so
now
it's just stored on the window, which lets us avoid the boilerplate of
keeping
all the matchers in sync.

This stops us from losing multikey bindings when the context on a node
changes
(#11009) (though we still interrupt multikey bindings if the focus
changes).

While in the code, I fixed up a few other things with multi-key bindings
that
were causing problems:

Previously we assumed that all multi-key bindings took precedence over
any
single-key binding, now this is done such that if a user binds a
single-key
binding, it will take precedence over all system-defined multi-key
bindings
(irrespective of the depth in the context tree). This was a common cause
of
confusion for new users trying to bind to `cmd-k` or `ctrl-w` in vim
mode
(#13543).

Previously after a pending multi-key keystroke failed to match, we would
drop
the prefix if it was an input event. Now we correctly replay it
(#14725).

Release Notes:

- Fixed multi-key shortcuts not working across completion menu changes
([#11009](https://github.com/zed-industries/zed/issues/11009))
- Fixed multi-key shortcuts discarding earlier input
([#14445](https://github.com/zed-industries/zed/pull/14445))
- vim: Fixed `jk` binding preventing you from repeating `j`
([#14725](https://github.com/zed-industries/zed/issues/14725))
- vim: Fixed `escape` in normal mode to also clear the selected
register.
- Fixed key maps so user-defined mappings take precedence over builtin
multi-key mappings
([#13543](https://github.com/zed-industries/zed/issues/13543))
- Fixed a bug where overridden shortcuts would still show in the Command
Palette
2024-07-22 10:46:16 -06:00
..
neovim_backed_test_context_works.json
test_a.json
test_b.json
test_backspace.json
test_builtin_marks.json vim: Add basic mark support (#11507) 2024-05-09 18:51:19 -06:00
test_capital_f_and_capital_t.json
test_caret_mark.json vim gigv (#13028) 2024-06-14 10:16:59 -06:00
test_cc.json
test_cgn_nomatch.json vim: Fix cgn backwards movement when there is no matches (#10237) 2024-04-08 14:51:36 -06:00
test_cgn_repeat.json vim: Support gn command and remap gn to gl (#9982) 2024-04-05 20:23:37 -06:00
test_change_0.json
test_change_b.json
test_change_backspace.json
test_change_case.json Add visual area repeating 2023-09-07 10:45:38 -06:00
test_change_case_motion.json vim: Add gU/gu/g~ (#12782) 2024-06-07 12:38:12 -06:00
test_change_cc.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_change_e.json
test_change_end_of_document.json
test_change_end_of_line.json
test_change_gg.json
test_change_h.json
test_change_j.json
test_change_k.json
test_change_l.json
test_change_list_delete.json vim cl (#11641) 2024-05-09 21:18:56 -06:00
test_change_list_insert.json vim cl (#11641) 2024-05-09 21:18:56 -06:00
test_change_paragraph_object.json vim: Add support for ap and ip paragraph text objects (#7687) 2024-03-04 16:39:02 -07:00
test_change_sentence_object.json
test_change_surrounding_character_objects.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_change_w.json Fix VIM cw on last character of a word doesn't work as expected: (#10963) 2024-04-25 21:09:06 -06:00
test_change_word_object.json
test_clear_counts.json Fix 0 used in a count 2023-09-12 09:56:23 -06:00
test_comma_semicolon.json vim: fix t not being repeatable with , (#7007) 2024-01-30 09:17:19 +01:00
test_comma_w.json Work on tests 2024-01-21 22:00:35 -07:00
test_command_basics.json Flesh out v1.0 of vim : 2023-09-20 20:44:41 -06:00
test_command_goto.json Flesh out v1.0 of vim : 2023-09-20 20:44:41 -06:00
test_command_replace.json vim: Fix some dw edge cases 2023-09-27 23:09:09 -06:00
test_command_search.json Fix backward search from command 2023-09-20 20:44:42 -06:00
test_convert_to_lower_case.json Add support for u and U in vim visual mode 2024-01-28 15:13:09 -05:00
test_convert_to_upper_case.json Add support for u and U in vim visual mode 2024-01-28 15:13:09 -05:00
test_ctrl_d_u.json vim: Fix ctrl-d/u going to top bottom (#14620) 2024-07-16 22:56:44 -06:00
test_ctrl_w_override.json Refactor key dispatch (#14942) 2024-07-22 10:46:16 -06:00
test_d_search.json vim: Allow search with operators & visual mode (#10226) 2024-04-08 15:20:14 -06:00
test_dd.json
test_delete_0.json
test_delete_b.json
test_delete_end_of_document.json
test_delete_end_of_line.json
test_delete_gg.json
test_delete_h.json
test_delete_j.json
test_delete_k.json
test_delete_l.json
test_delete_left.json
test_delete_next_word_end.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_delete_paragraph_object.json vim: Add support for ap and ip paragraph text objects (#7687) 2024-03-04 16:39:02 -07:00
test_delete_sentence_object.json
test_delete_surrounding_character_objects.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_delete_to_adjacent_character.json add test_data 2024-01-26 20:02:59 -08:00
test_delete_to_end_of_line.json
test_delete_w.json vim: Fix some dw edge cases 2023-09-27 23:09:09 -06:00
test_delete_with_counts.json vim: Fix count handling to allow pre/post counts 2023-09-11 14:35:47 -06:00
test_delete_word_object.json
test_dgn_repeat.json vim: Support gn command and remap gn to gl (#9982) 2024-04-05 20:23:37 -06:00
test_dot_mark.json vim cl (#11641) 2024-05-09 21:18:56 -06:00
test_dot_repeat.json Fix 0 used in a count 2023-09-12 09:56:23 -06:00
test_dw_eol.json Fix dw at the end of a soft wrapped line (#13065) 2024-06-14 13:18:28 -06:00
test_end_of_document.json
test_end_of_line_downward.json vim: Fix g _ not having the expected behavior (#12607) 2024-06-05 15:00:13 -06:00
test_end_of_line_with_neovim.json Vim mode: make motion::EndOfLine works with times. (#8591) 2024-03-01 14:00:31 +01:00
test_end_of_word.json
test_enter.json
test_enter_visual_line_mode.json
test_enter_visual_mode.json
test_escape_while_waiting.json Refactor key dispatch (#14942) 2024-07-22 10:46:16 -06:00
test_f_and_t.json
test_find_multibyte.json vim: Fix c when range ends in a multibyte character (#14139) 2024-07-11 12:01:56 -06:00
test_folds.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_folds_panic.json Fix panic in visual line mode with folds (#10284) 2024-04-08 11:39:06 -06:00
test_gg.json
test_gi.json vim cl (#11641) 2024-05-09 21:18:56 -06:00
test_gn.json vim: Support gn command and remap gn to gl (#9982) 2024-04-05 20:23:37 -06:00
test_gv.json vim gigv (#13028) 2024-06-14 10:16:59 -06:00
test_h.json
test_h_through_unicode.json
test_increment.json vim: add ctrl-a/ctrl-x 2023-09-27 19:49:31 -06:00
test_increment_radix.json Fix panic in increment 2023-10-04 15:13:01 -06:00
test_increment_steps.json Fix single column vim selections 2023-10-20 11:17:19 -06:00
test_increment_with_dot.json vim: Increment search right (#10866) 2024-04-25 19:47:52 -06:00
test_increment_with_two_dots.json vim: Increment search right (#10866) 2024-04-25 19:47:52 -06:00
test_insert_ctrl_r.json Fix ctrl-r with no register (#13184) 2024-06-17 22:17:33 -06:00
test_insert_end_of_line.json
test_insert_first_non_whitespace.json
test_insert_line_above.json
test_insert_with_counts.json vim: ALlow counts on insert actions 2023-09-11 18:09:47 -06:00
test_insert_with_repeat.json vim: ALlow counts on insert actions 2023-09-11 18:09:47 -06:00
test_j.json Use Horizontal ranges everywhere 2023-10-09 21:48:50 -06:00
test_jk.json Work on tests 2024-01-21 22:00:35 -07:00
test_join_lines.json add vim-specific J (with repeatability) 2023-09-07 11:08:07 -06:00
test_jump_to_end.json
test_jump_to_first_non_whitespace.json
test_jump_to_line_boundaries.json
test_k.json
test_l.json
test_lowercase_marks.json vim: Add basic mark support (#11507) 2024-05-09 18:51:19 -06:00
test_lt_gt_marks.json vim gigv (#13028) 2024-06-14 10:16:59 -06:00
test_marks.json vim: Add basic mark support (#11507) 2024-05-09 18:51:19 -06:00
test_matching.json
test_multiline_surrounding_character_objects.json Add | as a bracket and a motion 2023-10-22 22:17:34 -06:00
test_named_registers.json Multicursor vim registers (#13025) 2024-06-13 20:32:58 -06:00
test_neovim.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_next_line_start.json
test_next_word_end_newline_last_char.json Fix Vim 'e' Behavior When Boundary Is Last Point on Line (#7424) 2024-02-06 20:25:56 -07:00
test_numbered_registers.json vim: Implement named registers (#12895) 2024-06-12 10:40:27 -06:00
test_o.json
test_paragraph_object_with_landing_positions_not_at_beginning_of_line.json vim: Add support for ap and ip paragraph text objects (#7687) 2024-03-04 16:39:02 -07:00
test_paragraphs_dont_wrap.json Don't wrap on paragraphs 2023-10-06 10:32:15 -06:00
test_paste.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_paste_count.json vim: Support paste with count (#11621) 2024-05-09 16:12:59 -06:00
test_paste_visual.json
test_paste_visual_block.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_percent.json
test_period_mark.json vim: Add basic mark support (#11507) 2024-05-09 18:51:19 -06:00
test_plus_minus.json vim: Add support for vim::PreviousLineStart motion (#14193) 2024-07-11 16:36:07 -06:00
test_previous_word_end.json vim: Implement Go To Previous Word End (#7505) 2024-02-15 16:15:31 -07:00
test_r.json vim: Fix issues with r/R (#13623) 2024-06-27 21:54:34 -06:00
test_record_replay.json vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
test_record_replay_count.json vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
test_record_replay_dot.json vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
test_record_replay_interleaved.json vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
test_record_replay_of_dot.json vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
test_remap_adjacent_dog_cat.json Refactor key dispatch (#14942) 2024-07-22 10:46:16 -06:00
test_remap_nested_pineapple.json Refactor key dispatch (#14942) 2024-07-22 10:46:16 -06:00
test_repeat_motion_counts.json vim: Fix count handling to allow pre/post counts 2023-09-11 14:35:47 -06:00
test_repeat_over_blur.json Fix some cases of broken repeat in vim 2024-01-18 13:20:08 -07:00
test_repeat_visual.json Add visual area repeating 2023-09-07 10:45:38 -06:00
test_repeated_cb.json
test_repeated_ce.json
test_repeated_cj.json
test_repeated_cl.json
test_repeated_word.json
test_replace_mode.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_replace_mode_repeat.json vim: Allow count and repeat for "r" and "shift-r" action (#13287) 2024-06-24 09:41:33 -06:00
test_replace_mode_undo.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_replace_mode_with_counts.json vim: Allow count and repeat for "r" and "shift-r" action (#13287) 2024-06-24 09:41:33 -06:00
test_replace_with_range.json vim: Fix %s replace not working more than twice (#12045) 2024-05-20 19:17:11 -06:00
test_replace_with_range_at_start.json Fix search/replace start of line anchor (#13920) 2024-07-09 12:39:24 -06:00
test_selection_goal.json Clear SelectionGoal on input 2023-10-05 09:02:52 -06:00
test_shift_y.json vim: Fix 'Y' to yank to end of line (#14783) 2024-07-18 22:34:40 -06:00
test_singleline_surrounding_character_objects.json vim: Adjust surrounding_markers method (#14752) 2024-07-18 11:53:51 -06:00
test_singleline_surrounding_character_objects_with_escape.json Improve logic for obtaining surrounds range in Vim mode (#10938) 2024-04-24 21:19:15 -06:00
test_special_registers.json Multicursor vim registers (#13025) 2024-06-13 20:32:58 -06:00
test_start_end_of_paragraph.json
test_substitute_line.json vim: Add S to substitute line 2023-09-01 13:13:59 -06:00
test_undo.json Improve vim undo (#9317) 2024-03-13 23:12:12 -06:00
test_undo_repeated_insert.json vim: Fix issues with r/R (#13623) 2024-06-27 21:54:34 -06:00
test_v_search.json vim: Allow search with operators & visual mode (#10226) 2024-04-08 15:20:14 -06:00
test_visual_block_insert.json
test_visual_block_issue_2123.json Make vim visual block work better 2023-10-18 22:23:06 -06:00
test_visual_block_mode.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_visual_block_search.json vim: Allow search with operators & visual mode (#10226) 2024-04-08 15:20:14 -06:00
test_visual_change.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_visual_delete.json
test_visual_line_change.json
test_visual_line_delete.json
test_visual_match_eol.json vim: fix v$% (#10051) 2024-04-01 14:18:09 -06:00
test_visual_object.json
test_visual_paragraph_object.json vim: Add support for ap and ip paragraph text objects (#7687) 2024-03-04 16:39:02 -07:00
test_visual_sentence_object.json
test_visual_shift_d.json Fix some edge-cases in vim visual delete (#12131) 2024-05-22 12:54:41 -06:00
test_visual_star_hash.json Don't toggle WHOLE_WORD in vim search 2024-01-19 10:58:55 -07:00
test_visual_word_object.json
test_visual_yank.json vim test redux (#11709) 2024-05-11 14:04:05 -04:00
test_w.json
test_window_bottom.json vim: Support counts for H and L motions (#7149) 2024-01-31 11:50:08 -07:00
test_window_middle.json vim: Add support for moving to first, middle and last visible lines (H, L, M) (#6919) 2024-01-29 20:58:24 -07:00
test_window_top.json vim: Support counts for H and L motions (#7149) 2024-01-31 11:50:08 -07:00
test_wrapped_lines.json Fix f,t on soft-wrapped lines 2023-09-08 10:16:46 -06:00
test_wrapped_motions.json Make vim visual block work better 2023-10-18 22:23:06 -06:00
test_x.json
test_zero.json Fix 0 used in a count 2023-09-12 09:56:23 -06:00