.
This commit is contained in:
@@ -9,7 +9,6 @@ common = { path = "../common" }
|
||||
theme = { path = "../theme" }
|
||||
|
||||
gpui.workspace = true
|
||||
smol.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
smallvec.workspace = true
|
||||
@@ -25,3 +24,6 @@ lsp-types = "0.97.0"
|
||||
ropey = { version = "=2.0.0-beta.1", features = ["metric_lines_lf", "metric_utf16"] }
|
||||
sum_tree = { git = "https://github.com/zed-industries/zed" }
|
||||
tree-sitter = "0.26"
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
smol.workspace = true
|
||||
|
||||
@@ -14,9 +14,9 @@ use super::folding::FoldRange;
|
||||
use super::text_wrapper::{LineItem, WrapDisplayPoint};
|
||||
use super::wrap_map::WrapMap;
|
||||
use super::{BufferPoint, DisplayPoint};
|
||||
use crate::input::Point as TreeSitterPoint;
|
||||
use crate::input::display_map::WrapPoint;
|
||||
use crate::input::rope_ext::RopeExt as _;
|
||||
use crate::input::Point as TreeSitterPoint;
|
||||
|
||||
/// DisplayMap is the main interface for Editor/Input coordinate mapping.
|
||||
///
|
||||
@@ -269,10 +269,7 @@ impl DisplayMap {
|
||||
|
||||
/// Convert wrap display point to TreeSitterPoint (buffer line/col).
|
||||
#[inline]
|
||||
pub(crate) fn wrap_display_point_to_point(
|
||||
&self,
|
||||
point: WrapDisplayPoint,
|
||||
) -> TreeSitterPoint {
|
||||
pub(crate) fn wrap_display_point_to_point(&self, point: WrapDisplayPoint) -> TreeSitterPoint {
|
||||
self.wrap_map.wrapper().display_point_to_point(point)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ use gpui::{
|
||||
SharedString, StatefulInteractiveElement, StyleRefinement, Styled, Subscription, Task,
|
||||
UniformListScrollHandle, Window, div, px, size, uniform_list,
|
||||
};
|
||||
use smol::Timer;
|
||||
use theme::ActiveTheme;
|
||||
|
||||
use crate::actions::{Cancel, Confirm, SelectDown, SelectUp};
|
||||
@@ -265,6 +264,7 @@ where
|
||||
}
|
||||
|
||||
self.set_searching(true, window, cx);
|
||||
|
||||
let search = self.delegate.perform_search(&text, window, cx);
|
||||
|
||||
if self.rows_cache.len() > 0 {
|
||||
@@ -273,6 +273,7 @@ where
|
||||
self._set_selected_index(None, window, cx);
|
||||
}
|
||||
|
||||
let executor = cx.background_executor().clone();
|
||||
self._search_task = cx.spawn_in(window, async move |this, window| {
|
||||
search.await;
|
||||
|
||||
@@ -282,7 +283,8 @@ where
|
||||
});
|
||||
|
||||
// Always wait 100ms to avoid flicker
|
||||
Timer::after(Duration::from_millis(100)).await;
|
||||
executor.timer(Duration::from_millis(100)).await;
|
||||
|
||||
_ = this.update_in(window, |this, window, cx| {
|
||||
this.set_searching(false, window, cx);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user