Michael Sloan
d7f0241d7b
editor: Defer the effects of change_selections to end of transact ( #31731 )
...
In quite a few places the selection is changed multiple times in a
transaction. For example, `backspace` might do it 3 times:
* `select_autoclose_pair`
* selection of the ranges to delete
* `insert` of empty string also updates selection
Before this change, each of these selection changes appended to
selection history and did a bunch of work that's only relevant to
selections the user actually sees. So for each backspace,
`editor::UndoSelection` would need to be invoked 3-4 times before the
cursor actually moves. It still needs to be run twice after this change,
but that is a separate issue.
Signature help even had a `backspace_pressed: bool` as an incomplete
workaround, to avoid it flickering due to the selection switching
between being a range and being cursor-like.
The original motivation for this change is work I'm doing on not
re-querying completions when the language server provides a response
that has `is_incomplete: false`. Whether the menu is still visible is
determined by the cursor position, and this was complicated by it seeing
`backspace` temporarily moving the head of the selection 1 character to
the left.
This change also removes some redundant uses of
`push_to_selection_history`.
Not super stoked with the name `DeferredSelectionEffectsState`. Naming
is hard.
Release Notes:
- N/A
2025-05-30 01:53:02 -06:00
..
2025-05-29 01:58:40 +00:00
2025-05-29 22:07:34 +00:00
2025-05-29 13:12:42 +00:00
2025-05-22 21:00:54 +00:00
2025-05-16 05:04:36 -04:00
2025-05-20 23:06:07 +00:00
2025-05-29 20:43:12 +00:00
2025-05-21 09:27:54 +00:00
2025-05-26 11:48:50 -04:00
2025-05-28 18:44:49 +00:00
2025-05-29 20:43:12 +00:00
2025-05-26 21:20:41 -03:00
2025-05-28 11:51:21 -04:00
2025-05-20 23:06:07 +00:00
2025-05-08 14:10:30 +00:00
2025-04-02 13:26:34 -07:00
2025-05-27 10:54:42 +02:00
2025-04-07 20:26:55 +00:00
2025-05-26 11:48:50 -04:00
2025-05-26 23:04:31 -04:00
2025-05-26 23:04:31 -04:00
2025-05-20 23:06:07 +00:00
2025-05-26 23:04:31 -04:00
2025-05-04 08:28:39 +00:00
2025-05-29 23:49:14 +00:00
2025-05-26 23:04:31 -04:00
2025-04-02 13:26:34 -07:00
2025-05-26 23:04:31 -04:00
2025-04-02 13:26:34 -07:00
2025-05-14 23:29:11 +02:00
2025-05-26 10:29:45 +02:00
2025-05-26 23:04:31 -04:00
2025-04-02 13:26:34 -07:00
2025-05-29 21:19:56 +02:00
2025-05-30 04:22:16 +03:00
2025-05-20 00:20:00 +00:00
2025-05-22 07:24:46 -04:00
2025-05-14 11:15:27 +02:00
2025-05-29 21:33:52 -04:00
2025-05-20 23:06:07 +00:00
2025-05-26 23:04:31 -04:00
2025-05-27 16:56:03 +00:00
2025-05-30 01:53:02 -06:00
2025-05-29 20:43:12 +00:00
2025-05-26 16:06:38 +02:00
2025-05-26 16:06:38 +02:00
2025-05-20 23:06:07 +00:00
2025-05-26 11:48:50 -04:00
2025-05-29 22:07:34 +00:00
2025-05-17 16:42:45 +00:00
2025-05-23 14:53:53 +00:00
2025-05-28 21:29:51 +00:00
2025-04-02 13:26:34 -07:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-12 14:43:14 +00:00
2025-05-26 11:31:25 +00:00
2025-05-20 23:06:07 +00:00
2025-05-29 20:43:12 +00:00
2025-05-07 23:11:09 +03:00
2025-05-27 10:54:42 +02:00
2025-05-29 21:33:52 -04:00
2025-05-26 17:43:57 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-27 19:44:10 -03:00
2025-05-20 23:06:07 +00:00
2025-05-20 23:06:07 +00:00
2025-05-20 23:06:07 +00:00
2025-05-27 21:52:42 +00:00
2025-05-26 17:43:57 +00:00
2025-05-20 23:06:07 +00:00
2025-05-17 16:42:45 +00:00
2025-05-17 16:42:45 +00:00
2025-04-23 20:54:09 +00:00
2025-05-29 20:51:20 +00:00
2025-05-08 14:01:39 +02:00
2025-05-29 20:43:12 +00:00
2025-05-29 20:43:12 +00:00
2025-05-20 23:06:07 +00:00
2025-05-27 00:57:45 +03:00
2025-05-29 20:51:20 +00:00
2025-05-20 23:06:07 +00:00
2025-05-20 23:06:07 +00:00
2025-05-26 13:54:17 +02:00
2025-05-26 11:48:50 -04:00
2025-05-29 21:41:15 +00:00
2025-05-21 12:57:51 -04:00
2025-05-20 23:06:07 +00:00
2025-04-29 21:58:45 -03:00
2025-05-20 23:06:07 +00:00
2025-05-22 14:22:35 -04:00
2025-05-28 23:05:06 +00:00
2025-05-21 21:17:14 +03:00
2025-05-14 23:29:11 +02:00
2025-05-22 14:22:35 -04:00
2025-05-26 11:46:35 +00:00
2025-05-26 23:04:31 -04:00
2025-05-26 23:04:31 -04:00
2025-04-02 13:26:34 -07:00
2025-05-27 14:14:25 -04:00
2025-05-29 12:55:47 +00:00
2025-05-20 23:06:07 +00:00
2025-05-29 23:02:59 +00:00
2025-05-26 23:04:31 -04:00
2025-05-26 23:04:31 -04:00
2025-05-20 23:06:07 +00:00
2025-05-26 22:19:02 +03:00
2025-05-29 09:24:39 +05:30
2025-05-26 17:43:57 +00:00
2025-05-23 14:53:53 +00:00
2025-05-27 16:56:27 +00:00
2025-05-27 23:01:31 +00:00
2025-05-29 22:07:34 +00:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-26 11:48:50 -04:00
2025-05-26 11:48:50 -04:00
2025-05-29 20:43:12 +00:00
2025-04-02 13:26:34 -07:00
2025-05-26 23:04:31 -04:00
2025-05-29 20:43:12 +00:00
2025-05-20 23:06:07 +00:00
2025-04-25 17:41:49 +03:00
2025-05-27 14:14:25 -04:00
2025-05-27 14:14:25 -04:00
2025-05-20 23:06:07 +00:00
2025-05-26 23:04:31 -04:00
2025-05-26 13:44:09 +00:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-16 17:35:44 +02:00
2025-05-20 23:06:07 +00:00
2025-05-01 17:37:43 +02:00
2025-05-26 11:48:50 -04:00
2025-04-02 13:26:34 -07:00
2025-05-23 20:45:32 +00:00
2025-05-29 16:09:07 +00:00
2025-05-30 04:22:16 +03:00
2025-05-29 21:33:52 -04:00
2025-04-02 13:26:34 -07:00
2025-04-21 21:30:21 -07:00
2025-05-23 14:28:53 +03:00
2025-05-29 08:55:12 +05:30
2025-05-28 12:32:54 +00:00
2025-05-26 18:23:41 +00:00
2025-04-02 13:26:34 -07:00
2025-05-26 18:23:41 +00:00
2025-04-28 14:29:17 +00:00
2025-05-06 10:18:48 +00:00
2025-05-28 11:51:21 -04:00
2025-05-26 23:04:31 -04:00
2025-05-29 21:41:15 +00:00
2025-05-14 23:29:11 +02:00
2025-05-23 19:31:25 +00:00
2025-04-07 19:03:24 +00:00
2025-05-28 10:16:34 -04:00
2025-05-01 19:24:14 +00:00
2025-05-28 06:30:51 +05:30
2025-04-23 20:54:09 +00:00
2025-04-23 15:30:20 +00:00
2025-05-20 23:06:07 +00:00
2025-05-29 15:20:58 -04:00
2025-05-29 21:33:52 -04:00
2025-05-26 23:04:31 -04:00
2025-05-29 21:33:52 -04:00
2025-05-26 19:40:07 +00:00
2025-05-26 11:48:50 -04:00
2025-05-26 11:48:50 -04:00
2025-04-23 20:54:09 +00:00