Dino
af5318df98
Update default vim substitute command behavior and add support for 'g' flag ( #28138 )
...
This Pull Request updates the default behavior of the substitute (`s`)
command in vim mode to only replace the next match by default, instead
of all, and replace all matches only when the `g` flag is provided,
making it more similar to NeoVim's behavior.
In order to achieve this, the following changes were introduced:
- Update `BufferSearchBar::replace_next` to be a public method, so it
can be called from `Vim::replace_command` .
- Update the `Replacement::parse` to set the `should_replace_all` field
to `false` by default, and only set it to `true` if the `'g'` flag is
present in the query.
- Add support for when the `Replacement.should_replace_all` is set to
`false` in `Vim::replace_command`, so as to have it only replace the
next occurrence instead of all occurrences in the line.
- Introduce `BufferSearchBar::select_first_match` so as to activate the
first match on the line under the cursor.
Closes #24450
Release Notes:
- Improved vim's substitute command so as to only replace the first
match by default, and replace all matches if the `'g'` flag is provided
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com >
2025-04-09 14:34:51 -06:00
..
2025-04-07 18:10:01 +00:00
2025-04-09 19:00:23 +00:00
2025-04-07 13:28:06 -05:00
2025-04-09 10:19:54 +00:00
2025-04-04 17:09:00 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-05 17:10:39 +00:00
2025-04-09 17:13:41 +00:00
2025-04-04 11:40:55 -03:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 21:37:10 +00:00
2025-04-09 14:34:51 -06:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-05 11:16:26 -04:00
2025-04-07 20:26:55 +00:00
2025-04-02 13:26:34 -07:00
2025-04-08 16:01:27 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 09:17:08 -06:00
2025-04-02 13:26:34 -07:00
2025-04-08 15:07:56 -06:00
2025-04-09 14:34:51 -06:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 16:09:06 -06:00
2025-04-08 16:09:06 -06:00
2025-04-08 21:37:10 +00:00
2025-04-02 13:26:34 -07:00
2025-04-08 22:16:27 +02:00
2025-04-02 13:26:34 -07:00
2025-04-09 12:57:24 +02:00
2025-04-09 12:57:24 +02:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-09 19:57:29 +00:00
2025-04-02 13:26:34 -07:00
2025-04-04 17:37:42 -06:00
2025-04-02 13:26:34 -07:00
2025-04-09 14:34:51 -06:00
2025-04-02 13:26:34 -07:00
2025-04-05 13:20:36 -04:00
2025-03-31 20:55:27 +02:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-05 05:01:56 +05:30
2025-04-02 13:26:34 -07:00
2025-04-07 18:46:09 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 11:28:34 -04:00
2025-04-02 13:26:34 -07:00
2025-04-09 10:46:21 -04:00
2025-04-02 13:26:34 -07:00
2025-04-08 15:00:23 +00:00
2025-04-09 14:28:15 -06:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 20:13:49 -03:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-09 01:53:54 +00:00
2025-04-02 13:26:34 -07:00
2025-04-08 15:00:23 +00:00
2025-04-05 16:32:16 +00:00
2025-04-08 14:46:15 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 15:07:56 -06:00
2025-04-02 13:26:34 -07:00
2025-04-08 16:01:27 +00:00
2025-04-02 13:26:34 -07:00
2025-04-07 10:35:11 -06:00
2025-04-08 23:45:49 +00:00
2025-04-02 13:26:34 -07:00
2025-04-07 18:46:09 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 22:01:40 +00:00
2025-04-07 15:47:04 -04:00
2025-04-08 16:09:06 -06:00
2025-04-02 13:26:34 -07:00
2025-04-03 22:07:37 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-09 14:34:51 -06:00
2025-04-08 18:00:01 +05:30
2025-04-02 13:26:34 -07:00
2025-04-04 11:40:55 -03:00
2025-04-09 10:09:48 -04:00
2025-04-08 22:03:03 +00:00
2025-04-09 03:26:22 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 22:16:35 -04:00
2025-04-08 09:17:08 -06:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-03 23:32:50 +02:00
2025-04-08 22:16:27 +02:00
2025-04-02 13:26:34 -07:00
2025-04-09 14:34:51 -06:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 16:09:06 -06:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-08 15:57:36 -06:00
2025-04-04 14:20:09 +00:00
2025-04-08 15:07:56 -06:00
2025-04-02 13:26:34 -07:00
2025-04-04 19:28:32 -04:00
2025-04-08 12:16:18 +05:30
2025-04-08 22:16:27 +02:00
2025-04-09 01:53:54 +00:00
2025-04-09 10:49:39 -04:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-04-06 11:25:29 -06:00
2025-04-02 13:26:34 -07:00
2025-04-08 16:09:06 -06:00
2025-04-08 16:09:06 -06:00
2025-04-08 16:09:06 -06:00
2025-04-07 19:03:24 +00:00
2025-04-08 16:55:35 +00:00
2025-04-02 13:26:34 -07:00
2025-04-09 14:34:51 -06:00
2025-04-02 13:26:34 -07:00
2025-04-08 16:09:06 -06:00
2025-04-07 23:22:09 +02:00
2025-04-09 12:44:29 -04:00
2025-04-09 14:23:19 -06:00
2025-04-05 17:10:39 +00:00
2025-04-09 14:21:07 -03:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00