chore: Locking core-text version
This commit is contained in:
parent
76424dd0ae
commit
c67821ef39
7 changed files with 12 additions and 12 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -2833,6 +2833,7 @@ dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
"core-text",
|
||||||
"enum-iterator",
|
"enum-iterator",
|
||||||
"gpui",
|
"gpui",
|
||||||
"gpui-component-macros",
|
"gpui-component-macros",
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ Here is the first application: [Longbridge Pro](https://longbridge.com/desktop),
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
gpui = "0.2.2"
|
gpui = "0.2.2"
|
||||||
gpui-component = "0.4.0"
|
gpui-component = "0.5.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Basic Example
|
### Basic Example
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,4 @@ quote = "1.0"
|
||||||
syn = "2.0"
|
syn = "2.0"
|
||||||
|
|
||||||
[package.metadata.cargo-machete]
|
[package.metadata.cargo-machete]
|
||||||
ignored = ["proc-macro2"]
|
ignored = ["proc-macro2", "core-text"]
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,9 @@ tree-sitter-typescript = { version = "0.23.2", optional = true }
|
||||||
tree-sitter-yaml = { version = "0.7.1", optional = true }
|
tree-sitter-yaml = { version = "0.7.1", optional = true }
|
||||||
tree-sitter-zig = { version = "1.1.2", optional = true }
|
tree-sitter-zig = { version = "1.1.2", optional = true }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
|
core-text = "=21.0.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
gpui = { workspace = true, features = ["test-support"] }
|
gpui = { workspace = true, features = ["test-support"] }
|
||||||
indoc = "2"
|
indoc = "2"
|
||||||
|
|
|
||||||
|
|
@ -925,8 +925,7 @@ impl InputState {
|
||||||
let left_part = self.text.slice(0..offset).to_string();
|
let left_part = self.text.slice(0..offset).to_string();
|
||||||
|
|
||||||
UnicodeSegmentation::split_word_bound_indices(left_part.as_str())
|
UnicodeSegmentation::split_word_bound_indices(left_part.as_str())
|
||||||
.filter(|(_, s)| !s.trim_start().is_empty())
|
.rfind(|(_, s)| !s.trim_start().is_empty())
|
||||||
.next_back()
|
|
||||||
.map(|(i, _)| i)
|
.map(|(i, _)| i)
|
||||||
.unwrap_or(0)
|
.unwrap_or(0)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1232,13 +1232,10 @@ impl Render for PopupMenu {
|
||||||
let view = cx.entity().clone();
|
let view = cx.entity().clone();
|
||||||
let items_count = self.menu_items.len();
|
let items_count = self.menu_items.len();
|
||||||
|
|
||||||
let max_height = self.max_height.map_or_else(
|
let max_height = self.max_height.unwrap_or_else(|| {
|
||||||
|| {
|
let window_half_height = window.window_bounds().get_bounds().size.height * 0.5;
|
||||||
let window_half_height = window.window_bounds().get_bounds().size.height * 0.5;
|
window_half_height.min(px(450.))
|
||||||
window_half_height.min(px(450.))
|
});
|
||||||
},
|
|
||||||
|height| height,
|
|
||||||
);
|
|
||||||
|
|
||||||
let has_left_icon = self
|
let has_left_icon = self
|
||||||
.menu_items
|
.menu_items
|
||||||
|
|
|
||||||
|
|
@ -484,7 +484,7 @@ impl TextView {
|
||||||
pub fn style(mut self, style: TextViewStyle) -> Self {
|
pub fn style(mut self, style: TextViewStyle) -> Self {
|
||||||
if let Some(init_state) = &mut self.init_state {
|
if let Some(init_state) = &mut self.init_state {
|
||||||
match init_state {
|
match init_state {
|
||||||
InitState::Initializing { style: s, .. } => *s = Box::new(style),
|
InitState::Initializing { style: s, .. } => **s = style,
|
||||||
InitState::Initialized { tx } => {
|
InitState::Initialized { tx } => {
|
||||||
let _ = tx.try_send(Update::Style(Box::new(style)));
|
let _ = tx.try_send(Update::Style(Box::new(style)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue