Merge branch 'main' into dispatch-tree

This commit is contained in:
Conrad Irwin 2023-11-13 12:50:30 -07:00
commit f464d69ff8
20 changed files with 2801 additions and 2730 deletions

View file

@ -97,7 +97,7 @@ use text::{OffsetUtf16, Rope};
use theme::{
ActiveTheme, DiagnosticStyle, PlayerColor, SyntaxTheme, Theme, ThemeColors, ThemeSettings,
};
use ui::IconButton;
use ui::{IconButton, StyledExt};
use util::{post_inc, RangeExt, ResultExt, TryFutureExt};
use workspace::{
item::ItemEvent, searchable::SearchEvent, ItemNavHistory, SplitDirection, ViewId, Workspace,
@ -1555,6 +1555,7 @@ impl CodeActionsMenu {
let colors = cx.theme().colors();
div()
.px_2()
.text_ui()
.text_color(colors.text)
.when(selected, |style| {
style
@ -1582,7 +1583,7 @@ impl CodeActionsMenu {
.collect()
},
)
.bg(cx.theme().colors().element_background)
.elevation_1(cx)
.px_2()
.py_1()
.with_width_from_item(

View file

@ -1,3 +1,7 @@
use gpui::TestAppContext;
use language::language_settings::{AllLanguageSettings, AllLanguageSettingsContent};
use settings::SettingsStore;
// use super::*;
// use crate::{
// scroll::scroll_amount::ScrollAmount,
@ -8152,16 +8156,16 @@
// });
// }
// pub(crate) fn update_test_language_settings(
// cx: &mut TestAppContext,
// f: impl Fn(&mut AllLanguageSettingsContent),
// ) {
// cx.update(|cx| {
// cx.update_global::<SettingsStore, _, _>(|store, cx| {
// store.update_user_settings::<AllLanguageSettings>(cx, f);
// });
// });
// }
pub(crate) fn update_test_language_settings(
cx: &mut TestAppContext,
f: impl Fn(&mut AllLanguageSettingsContent),
) {
cx.update(|cx| {
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_settings::<AllLanguageSettings>(cx, f);
});
});
}
// pub(crate) fn update_test_project_settings(
// cx: &mut TestAppContext,

File diff suppressed because it is too large Load diff

View file

@ -11,19 +11,18 @@ pub enum ScrollAmount {
impl ScrollAmount {
pub fn lines(&self, editor: &mut Editor) -> f32 {
todo!()
// match self {
// Self::Line(count) => *count,
// Self::Page(count) => editor
// .visible_line_count()
// .map(|mut l| {
// // for full pages subtract one to leave an anchor line
// if count.abs() == 1.0 {
// l -= 1.0
// }
// (l * count).trunc()
// })
// .unwrap_or(0.),
// }
match self {
Self::Line(count) => *count,
Self::Page(count) => editor
.visible_line_count()
.map(|mut l| {
// for full pages subtract one to leave an anchor line
if count.abs() == 1.0 {
l -= 1.0
}
(l * count).trunc()
})
.unwrap_or(0.),
}
}
}