mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-24 21:59:04 +00:00
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.
13 lines
468 B
JSON
13 lines
468 B
JSON
{"Put":{"state":"ˇ/*\n this is a comment\n*/"}}
|
|
{"Key":"%"}
|
|
{"Get":{"state":"/*\n this is a comment\nˇ*/","mode":"Normal"}}
|
|
{"Key":"%"}
|
|
{"Get":{"state":"ˇ/*\n this is a comment\n*/","mode":"Normal"}}
|
|
{"Key":"%"}
|
|
{"Get":{"state":"/*\n this is a comment\nˇ*/","mode":"Normal"}}
|
|
{"Key":"k"}
|
|
{"Key":"%"}
|
|
{"Get":{"state":"/*\nˇ this is a comment\n*/","mode":"Normal"}}
|
|
{"Put":{"state":"ˇ// comment"}}
|
|
{"Key":"%"}
|
|
{"Get":{"state":"ˇ// comment","mode":"Normal"}}
|