zed/crates/vim/test_data
Juan Pablo Briones 0bcf71f786
vim: Add C preprocessor check in matching function (#55515)
Closes #24820

This PR fixes the bug specified in issue
https://github.com/zed-industries/zed/issues/24820, now the matching
function checks if the cursor is above a comment or a directive before
defaulting to a bracket range as neovim does.

It also fixes fixes the `line_end` calculations so that when `%` is
pressed inside a bracket range


https://github.com/user-attachments/assets/f59daa6f-9769-45e8-bb8c-2d533470b59d

Release Notes:

- `fn matching()` checks for `preprocessor directives` or `comments`
before defaulting to any bracket range.
- In `fn matching()`line_end calculations avoid expanding a blank
current line into start..EOF.
2026-05-07 04:25:42 +00:00
..
neovim_backed_test_context_works.json
test_a.json
test_around_containing_word_indent.json
test_b.json
test_backspace.json
test_backspace_non_ascii_bol.json
test_backwards_n.json
test_blackhole_register.json
test_builtin_marks.json
test_capital_f_and_capital_t.json
test_caret_mark.json
test_cc.json
test_cgn_nomatch.json
test_cgn_repeat.json
test_change_0.json
test_change_b.json
test_change_backspace.json
test_change_case.json
test_change_case_motion.json
test_change_case_motion_object.json
test_change_cc.json
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
test_change_list_insert.json
test_change_paragraph.json Fix yank around paragraph missing newline (#43583) 2025-12-03 17:11:53 +00:00
test_change_paragraph_object.json
test_change_paragraph_object_with_soft_wrap.json
test_change_rot13_motion.json
test_change_rot13_object.json
test_change_sentence_object.json
test_change_surrounding_character_objects.json
test_change_w.json
test_change_word_object.json
test_clear_counts.json
test_comma_semicolon.json
test_comma_w.json
test_command_basics.json
test_command_g_normal.json vim: Fix :g/pattern/norm commands applying on all matches (#43352) 2026-01-06 15:47:06 +00:00
test_command_goto.json
test_command_matching_lines.json
test_command_ranges.json
test_command_replace.json
test_command_search.json
test_command_visual_replace.json
test_convert_to_lower_case.json
test_convert_to_rot13.json
test_convert_to_upper_case.json
test_ctrl_d_u.json
test_ctrl_f_b.json
test_ctrl_o_dot.json
test_ctrl_o_position.json
test_ctrl_o_visual.json
test_ctrl_v.json
test_ctrl_v_control.json
test_ctrl_v_escape.json
test_ctrl_w_override.json
test_ctrl_y_e.json
test_d_search.json
test_dd.json
test_dd_then_paste_without_trailing_newline.json
test_del_marks.json
test_delete_0.json
test_delete_b.json
test_delete_end_of_document.json
test_delete_end_of_line.json
test_delete_end_of_paragraph.json
test_delete_gg.json
test_delete_h.json
test_delete_j.json
test_delete_k.json
test_delete_key_can_remove_last_character.json
test_delete_l.json
test_delete_left.json
test_delete_next_word_end.json
test_delete_paragraph.json
test_delete_paragraph_motion.json
test_delete_paragraph_object.json
test_delete_paragraph_object_with_soft_wrap.json
test_delete_paragraph_whitespace.json
test_delete_sentence.json
test_delete_sentence_object.json
test_delete_surrounding_character_objects.json
test_delete_to_adjacent_character.json
test_delete_to_end_of_line.json
test_delete_to_line.json
test_delete_unmatched_brace.json
test_delete_w.json
test_delete_with_counts.json
test_delete_word_object.json
test_dgn_repeat.json
test_digraph_find.json
test_digraph_insert_mode.json
test_digraph_insert_multicursor.json
test_digraph_keymap_conflict.json
test_digraph_replace.json
test_digraph_replace_mode.json
test_dot_mark.json
test_dot_repeat.json
test_dot_repeat_registers.json vim: Fix dot repeat ignoring recorded register (#50753) 2026-03-16 10:05:14 +00:00
test_dot_repeat_registers_paste.json vim: Fix dot repeat ignoring recorded register (#50753) 2026-03-16 10:05:14 +00:00
test_dw_eol.json
test_end_of_document.json
test_end_of_line_downward.json
test_end_of_line_with_neovim.json
test_end_of_line_with_vertical_motion.json vim: Make end of line infallible (#48867) 2026-02-10 10:33:50 +00: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
test_f_and_t.json
test_find_multibyte.json
test_folds.json
test_folds_panic.json
test_forced_motion_delete_to_end_of_line.json
test_forced_motion_delete_to_middle_of_line.json
test_forced_motion_delete_to_start_of_line.json
test_forced_motion_yank.json
test_gg.json
test_gi.json
test_gn.json
test_go_to_percentage.json
test_gq.json
test_gv.json
test_h.json
test_h_through_unicode.json
test_horizontal_scroll.json
test_inclusive_to_exclusive_delete.json
test_increment.json
test_increment_bin_wrapping_and_padding.json
test_increment_hex_casing.json
test_increment_hex_wrapping_and_padding.json
test_increment_inline.json
test_increment_markdown_list_markers_multiline.json Fix vim increment/decrement on Markdown list markers (#47978) 2026-02-04 23:52:43 +00:00
test_increment_radix.json Fix vim increment/decrement on Markdown list markers (#47978) 2026-02-04 23:52:43 +00:00
test_increment_sign_change.json
test_increment_sign_change_with_leading_zeros.json
test_increment_steps.json
test_increment_visual_partial_number.json
test_increment_with_changing_leading_zeros.json
test_increment_with_dot.json
test_increment_with_leading_zeros.json
test_increment_with_leading_zeros_and_zero.json
test_increment_with_two_dots.json
test_increment_wrapping.json
test_increment_zero_leading_zeros.json
test_indent_gv.json
test_insert_ctrl_r.json
test_insert_ctrl_y.json
test_insert_empty_line.json
test_insert_end_of_line.json
test_insert_first_non_whitespace.json
test_insert_line_above.json
test_insert_with_counts.json
test_insert_with_repeat.json
test_j.json
test_jk.json
test_jk_max_count.json
test_join_lines.json
test_jump_list.json
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
test_lt_gt_marks.json
test_marks.json
test_matching.json
test_matching_braces_in_tag.json
test_matching_comments.json vim: Add C preprocessor check in matching function (#55515) 2026-05-07 04:25:42 +00:00
test_matching_nested_brackets.json
test_matching_preprocessor_directives.json vim: Add C preprocessor check in matching function (#55515) 2026-05-07 04:25:42 +00:00
test_matching_quotes_disabled.json vim: Add use_match_quotes setting for % motion, default is true (#42615) 2026-01-09 18:04:44 +00:00
test_matching_tag_with_quotes.json vim: Add use_match_quotes setting for % motion, default is true (#42615) 2026-01-09 18:04:44 +00:00
test_matching_tags.json
test_minibrackets_trailing_space.json
test_named_registers.json
test_neovim.json
test_next_line_start.json
test_next_word_end_newline_last_char.json
test_normal_command.json vim: Allow trailing whitespace for :norm command (#46403) 2026-01-13 14:13:15 +00:00
test_numbered_registers.json
test_o.json
test_o_comment.json
test_offsets.json
test_p_g_v_y.json
test_paragraph_motion_with_whitespace_lines.json vim: Ensure paragraph motions use empty and not blank lines (#47734) 2026-01-27 13:33:53 +00:00
test_paragraph_multi_delete.json
test_paragraph_object_with_landing_positions_not_at_beginning_of_line.json
test_paragraphs_dont_wrap.json
test_paste.json
test_paste_count.json
test_paste_visual.json
test_paste_visual_block.json
test_percent.json
test_percent_in_comment.json vim: Implement text-based matching bracket logic for Vim '%' motion to correctly find pairs within comments (#45559) 2026-01-08 16:35:30 +00:00
test_period_mark.json
test_plus_minus.json
test_previous_word_end.json
test_quote_mark.json
test_r.json
test_record_replay.json
test_record_replay_count.json
test_record_replay_dot.json
test_record_replay_interleaved.json
test_record_replay_of_dot.json
test_record_replay_recursion.json
test_remap_adjacent_dog_cat.json
test_remap_nested_pineapple.json
test_remap_recursion.json
test_repeat_clear_count.json
test_repeat_clear_repeat.json
test_repeat_grouping_41735.json
test_repeat_motion_counts.json
test_repeat_over_blur.json
test_repeat_visual.json
test_repeated_cb.json
test_repeated_ce.json
test_repeated_cj.json
test_repeated_cl.json
test_repeated_word.json
test_replace_g.json
test_replace_gdefault.json vim: Add gdefault setting to set /g as a default substitution flag (#47664) 2026-01-27 17:04:10 +00:00
test_replace_literal_dollar.json Fix vim replace not escaping $ (#53277) 2026-04-27 08:53:44 +00:00
test_replace_mode.json
test_replace_mode_repeat.json
test_replace_mode_undo.json
test_replace_mode_with_counts.json
test_replace_n.json
test_replace_with_range.json
test_replace_with_range_at_start.json
test_scroll_beyond_last_line.json
test_scroll_jumps.json
test_search_skipping.json
test_selection_goal.json
test_sentence_backwards.json
test_sentence_forwards.json
test_shift_y.json
test_singleline_surrounding_character_objects.json
test_singleline_surrounding_character_objects_with_escape.json
test_space_non_ascii.json
test_space_non_ascii_eol.json
test_space_only_ascii_eol.json
test_special_registers.json
test_start_end_of_paragraph.json
test_substitute_line.json
test_temporary_mode.json
test_undo.json
test_undo_last_line.json
test_undo_last_line_newline.json
test_undo_last_line_newline_many_changes.json
test_undo_repeated_insert.json
test_unmatched_backward.json
test_unmatched_backward_markdown.json
test_unmatched_forward.json
test_unmatched_forward_markdown.json
test_v2ap.json
test_v_search.json
test_v_search_aa.json
test_visual_block_insert.json
test_visual_block_insert_after_ctrl_d_scroll.json vim: Fix visual block Shift-I jumping to original cursor after Ctrl-D scroll (#50822) 2026-03-18 10:59:46 +00:00
test_visual_block_issue_2123.json
test_visual_block_mode.json
test_visual_block_mode_down_right.json
test_visual_block_mode_other_end.json
test_visual_block_mode_shift_other_end.json
test_visual_block_mode_up_left.json
test_visual_block_search.json
test_visual_block_wrapping_selection.json
test_visual_change.json
test_visual_delete.json
test_visual_line_change.json
test_visual_line_delete.json
test_visual_match_eol.json
test_visual_mode_insert_before_after.json
test_visual_object.json
test_visual_object_expands.json
test_visual_paragraph_object.json
test_visual_paragraph_object_with_soft_wrap.json
test_visual_sentence_object.json
test_visual_shift_d.json
test_visual_star_hash.json
test_visual_word_object.json
test_visual_yank.json
test_w.json
test_window_bottom.json
test_window_middle.json
test_window_top.json
test_word_object_with_count.json vim: Fix word object count multiplier (2aw, 2iw) (#45686) 2026-01-05 09:13:25 -07:00
test_wrapped_delete_end_document.json
test_wrapped_lines.json
test_wrapped_motions.json
test_x.json
test_yank_line_with_trailing_newline.json
test_yank_line_without_trailing_newline.json
test_yank_multiline_without_trailing_newline.json
test_yank_paragraph_with_paste.json Fix yank around paragraph missing newline (#43583) 2025-12-03 17:11:53 +00:00
test_zero.json