mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-23 18:32:17 +00:00
Only debounce the cursor position in multibuffer excerpts (#21946)
Follow up to: https://github.com/zed-industries/zed/pull/20211 Release Notes: - Improved the performance of the cursor position indicator in single buffers
This commit is contained in:
parent
b3de19a6bd
commit
4eaa1c2514
1 changed files with 11 additions and 2 deletions
|
@ -48,8 +48,17 @@ impl CursorPosition {
|
|||
) {
|
||||
let editor = editor.downgrade();
|
||||
self.update_position = cx.spawn(|cursor_position, mut cx| async move {
|
||||
if let Some(debounce) = debounce {
|
||||
cx.background_executor().timer(debounce).await;
|
||||
let is_singleton = editor
|
||||
.update(&mut cx, |editor, cx| {
|
||||
editor.buffer().read(cx).is_singleton()
|
||||
})
|
||||
.ok()
|
||||
.unwrap_or(true);
|
||||
|
||||
if !is_singleton {
|
||||
if let Some(debounce) = debounce {
|
||||
cx.background_executor().timer(debounce).await;
|
||||
}
|
||||
}
|
||||
|
||||
editor
|
||||
|
|
Loading…
Reference in a new issue