Update dependencies

This commit is contained in:
Jeremy Soller 2025-03-31 09:16:20 -06:00
parent 98632f8747
commit 2fc1abe0b8
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
4 changed files with 543 additions and 533 deletions

1019
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -33,7 +33,7 @@ impl LineNumberCache {
let mut buffer_line = BufferLine::new( let mut buffer_line = BufferLine::new(
text, text,
LineEnding::default(), LineEnding::default(),
AttrsList::new(attrs), AttrsList::new(&attrs),
Shaping::Advanced, Shaping::Advanced,
); );
buffer_line.set_align(Some(Align::Left)); buffer_line.set_align(Some(Align::Left));

View file

@ -4,7 +4,8 @@ use cosmic::widget::menu::action::MenuAction;
use cosmic::widget::menu::key_bind::KeyBind; use cosmic::widget::menu::key_bind::KeyBind;
use cosmic::widget::segmented_button::Entity; use cosmic::widget::segmented_button::Entity;
use cosmic::{ use cosmic::{
app::{context_drawer, message, Core, Settings, Task}, action,
app::{context_drawer, Core, Settings, Task},
cosmic_config::{self, CosmicConfigEntry}, cosmic_config::{self, CosmicConfigEntry},
cosmic_theme, executor, cosmic_theme, executor,
font::Font, font::Font,
@ -684,7 +685,7 @@ impl App {
tab.set_config(&self.config); tab.set_config(&self.config);
} }
} }
cosmic::app::command::set_theme(self.config.app_theme.theme()) cosmic::command::set_theme(self.config.app_theme.theme())
} }
fn update_render_active_tab_zoom(&mut self, zoom_message: Message) -> Task<Message> { fn update_render_active_tab_zoom(&mut self, zoom_message: Message) -> Task<Message> {
@ -1129,7 +1130,7 @@ impl App {
items.push( items.push(
search_input search_input
.on_input(Message::ProjectSearchValue) .on_input(Message::ProjectSearchValue)
.on_submit(Message::ProjectSearchSubmit) .on_submit(|_| Message::ProjectSearchSubmit)
.into(), .into(),
); );
} }
@ -1181,7 +1182,7 @@ impl App {
None => { None => {
vec![search_input vec![search_input
.on_input(Message::ProjectSearchValue) .on_input(Message::ProjectSearchValue)
.on_submit(Message::ProjectSearchSubmit) .on_submit(|_| Message::ProjectSearchSubmit)
.into()] .into()]
} }
}; };
@ -1426,7 +1427,7 @@ impl Application for App {
} }
// The default nav_bar widget needs to be condensed for cosmic-edit // The default nav_bar widget needs to be condensed for cosmic-edit
fn nav_bar(&self) -> Option<Element<message::Message<Self::Message>>> { fn nav_bar(&self) -> Option<Element<action::Action<Self::Message>>> {
if !self.core().nav_bar_active() { if !self.core().nav_bar_active() {
return None; return None;
} }
@ -1444,7 +1445,7 @@ impl Application for App {
.button_height(space_xxxs + 20 /* line height */ + space_xxxs) .button_height(space_xxxs + 20 /* line height */ + space_xxxs)
.button_padding([space_s, space_xxxs, space_s, space_xxxs]) .button_padding([space_s, space_xxxs, space_s, space_xxxs])
.button_spacing(space_xxxs) .button_spacing(space_xxxs)
.on_activate(|entity| message::cosmic(cosmic::app::cosmic::Message::NavBar(entity))) .on_activate(|entity| action::cosmic(cosmic::app::Action::NavBar(entity)))
.spacing(space_none) .spacing(space_none)
.style(theme::SegmentedButton::TabBar) .style(theme::SegmentedButton::TabBar)
.apply(widget::container) .apply(widget::container)
@ -1946,7 +1947,7 @@ impl Application for App {
match GitRepository::new(&project_path) { match GitRepository::new(&project_path) {
Ok(repo) => match repo.stage(&path).await { Ok(repo) => match repo.stage(&path).await {
Ok(()) => { Ok(()) => {
return message::app(Message::UpdateGitProjectStatus); return action::app(Message::UpdateGitProjectStatus);
} }
Err(err) => { Err(err) => {
log::error!( log::error!(
@ -1965,7 +1966,7 @@ impl Application for App {
); );
} }
} }
message::none() action::none()
}, },
|x| x, |x| x,
); );
@ -1977,7 +1978,7 @@ impl Application for App {
match GitRepository::new(&project_path) { match GitRepository::new(&project_path) {
Ok(repo) => match repo.unstage(&path).await { Ok(repo) => match repo.unstage(&path).await {
Ok(()) => { Ok(()) => {
return message::app(Message::UpdateGitProjectStatus); return action::app(Message::UpdateGitProjectStatus);
} }
Err(err) => { Err(err) => {
log::error!( log::error!(
@ -1996,7 +1997,7 @@ impl Application for App {
); );
} }
} }
message::none() action::none()
}, },
|x| x, |x| x,
); );
@ -2220,7 +2221,7 @@ impl Application for App {
return Task::batch([ return Task::batch([
//TODO: why must this be done in a command? //TODO: why must this be done in a command?
Task::perform( Task::perform(
async move { message::app(Message::TabSetCursor(entity, cursor)) }, async move { action::app(Message::TabSetCursor(entity, cursor)) },
|x| x, |x| x,
), ),
self.update_tab(), self.update_tab(),
@ -2230,8 +2231,8 @@ impl Application for App {
} }
Message::Paste => { Message::Paste => {
return clipboard::read().map(|value_opt| match value_opt { return clipboard::read().map(|value_opt| match value_opt {
Some(value) => message::app(Message::PasteValue(value)), Some(value) => action::app(Message::PasteValue(value)),
None => message::none(), None => action::none(),
}); });
} }
Message::PasteValue(value) => { Message::PasteValue(value) => {
@ -2252,7 +2253,7 @@ impl Application for App {
match GitRepository::new(&project_path) { match GitRepository::new(&project_path) {
Ok(repo) => match repo.diff(&path, staged).await { Ok(repo) => match repo.diff(&path, staged).await {
Ok(diff) => { Ok(diff) => {
return message::app(Message::OpenGitDiff(project_path, diff)); return action::app(Message::OpenGitDiff(project_path, diff));
} }
Err(err) => { Err(err) => {
log::error!( log::error!(
@ -2271,7 +2272,7 @@ impl Application for App {
); );
} }
} }
message::none() action::none()
}, },
|x| x, |x| x,
); );
@ -2297,14 +2298,14 @@ impl Application for App {
async move { async move {
let task_res = tokio::task::spawn_blocking(move || { let task_res = tokio::task::spawn_blocking(move || {
project_search_result.search_projects(projects); project_search_result.search_projects(projects);
message::app(Message::ProjectSearchResult(project_search_result)) action::app(Message::ProjectSearchResult(project_search_result))
}) })
.await; .await;
match task_res { match task_res {
Ok(message) => message, Ok(message) => message,
Err(err) => { Err(err) => {
log::error!("failed to run search task: {}", err); log::error!("failed to run search task: {}", err);
message::none() action::none()
} }
} }
}, },
@ -2699,7 +2700,7 @@ impl Application for App {
} }
} }
} }
message::app(Message::GitProjectStatus(project_status)) action::app(Message::GitProjectStatus(project_status))
}, },
|x| x, |x| x,
); );
@ -2912,10 +2913,12 @@ impl Application for App {
widget::text_input::text_input(fl!("find-placeholder"), &self.find_search_value) widget::text_input::text_input(fl!("find-placeholder"), &self.find_search_value)
.id(self.find_search_id.clone()) .id(self.find_search_id.clone())
.on_input(Message::FindSearchValueChanged) .on_input(Message::FindSearchValueChanged)
.on_submit(if self.modifiers.contains(Modifiers::SHIFT) { .on_submit(|_| {
Message::FindPrevious if self.modifiers.contains(Modifiers::SHIFT) {
} else { Message::FindPrevious
Message::FindNext } else {
Message::FindNext
}
}) })
.width(Length::Fixed(320.0)) .width(Length::Fixed(320.0))
.trailing_icon( .trailing_icon(
@ -2963,7 +2966,7 @@ impl Application for App {
) )
.id(self.find_replace_id.clone()) .id(self.find_replace_id.clone())
.on_input(Message::FindReplaceValueChanged) .on_input(Message::FindReplaceValueChanged)
.on_submit(Message::FindReplace) .on_submit(|_| Message::FindReplace)
.width(Length::Fixed(320.0)) .width(Length::Fixed(320.0))
.trailing_icon( .trailing_icon(
button::custom(icon_cache_get("edit-clear-symbolic", 16)) button::custom(icon_cache_get("edit-clear-symbolic", 16))

View file

@ -54,7 +54,7 @@ impl EditorTab {
buffer.set_text( buffer.set_text(
font_system().write().unwrap().raw(), font_system().write().unwrap().raw(),
"", "",
attrs, &attrs,
Shaping::Advanced, Shaping::Advanced,
); );
@ -101,7 +101,7 @@ impl EditorTab {
let mut editor = self.editor.lock().unwrap(); let mut editor = self.editor.lock().unwrap();
let mut font_system = font_system().write().unwrap(); let mut font_system = font_system().write().unwrap();
let mut editor = editor.borrow_with(font_system.raw()); let mut editor = editor.borrow_with(font_system.raw());
match editor.load_text(&path, self.attrs) { match editor.load_text(&path, self.attrs.clone()) {
Ok(()) => { Ok(()) => {
log::info!("opened {:?}", path); log::info!("opened {:?}", path);
self.path_opt = match fs::canonicalize(&path) { self.path_opt = match fs::canonicalize(&path) {
@ -128,7 +128,7 @@ impl EditorTab {
let scroll = editor.with_buffer(|buffer| buffer.scroll()); let scroll = editor.with_buffer(|buffer| buffer.scroll());
//TODO: save/restore more? //TODO: save/restore more?
match editor.load_text(path, self.attrs) { match editor.load_text(path, self.attrs.clone()) {
Ok(()) => { Ok(()) => {
log::info!("reloaded {:?}", path); log::info!("reloaded {:?}", path);