Compare commits
15 commits
403d81e282
...
c3bd3782da
| Author | SHA1 | Date | |
|---|---|---|---|
| c3bd3782da | |||
| 30b334693f | |||
| 00e4487038 | |||
| cc2c274538 | |||
| 229b92c507 | |||
| cde36b1a5f | |||
| 6effc415e1 | |||
|
|
2600c6d38a | ||
|
|
dfcef22632 | ||
|
|
495f52cd5b | ||
|
|
eae9127fbe | ||
|
|
6ce200c84b | ||
|
|
b6627523f9 | ||
|
|
00a76ee709 | ||
|
|
bf217ab250 |
6 changed files with 419 additions and 485 deletions
816
Cargo.lock
generated
816
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "cosmic-edit"
|
||||
version = "1.0.14"
|
||||
version = "1.2.0"
|
||||
authors = ["Jeremy Soller <jeremy@system76.com>"]
|
||||
edition = "2024"
|
||||
license = "GPL-3.0-only"
|
||||
|
|
@ -40,7 +40,7 @@ default-features = false
|
|||
git = "https://github.com/pop-os/cosmic-syntax-theme.git"
|
||||
|
||||
[dependencies.cosmic-text]
|
||||
path = "../cosmic-text"
|
||||
version = "0.19"
|
||||
features = ["syntect", "vi"]
|
||||
|
||||
# Yoda fork.
|
||||
|
|
@ -70,6 +70,8 @@ debug = true
|
|||
[patch.crates-io]
|
||||
onig = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" }
|
||||
onig_sys = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" }
|
||||
# Yoda: unify cosmic-text with the local checkout used by libcosmic/iced/glyphon.
|
||||
cosmic-text = { path = "../cosmic-text" }
|
||||
|
||||
# Yoda wayland cut v5: redirect window_clipboard to the local fork
|
||||
# (x11 gated behind opt-in feature).
|
||||
|
|
@ -77,6 +79,3 @@ onig_sys = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main"
|
|||
window_clipboard = { path = "/home/lionel/Projets/COSMIC/window_clipboard" }
|
||||
dnd = { path = "/home/lionel/Projets/COSMIC/window_clipboard/dnd" }
|
||||
mime = { path = "/home/lionel/Projets/COSMIC/window_clipboard/mime" }
|
||||
|
||||
[patch.'https://github.com/pop-os/cosmic-text.git']
|
||||
cosmic-text = { path = "../cosmic-text" }
|
||||
|
|
|
|||
24
debian/changelog
vendored
24
debian/changelog
vendored
|
|
@ -1,3 +1,27 @@
|
|||
cosmic-edit (1.2.0) noble; urgency=medium
|
||||
|
||||
* Epoch 1.2.0 version update
|
||||
|
||||
-- Jeremy Soller <jeremy@system76.com> Tue, 30 Jun 2026 12:20:53 -0600
|
||||
|
||||
cosmic-edit (1.1.0) noble; urgency=medium
|
||||
|
||||
* Epoch 1.1.0 version update
|
||||
|
||||
-- Jeremy Soller <jeremy@system76.com> Tue, 23 Jun 2026 08:47:04 -0600
|
||||
|
||||
cosmic-edit (1.0.16) noble; urgency=medium
|
||||
|
||||
* Epoch 1.0.16 version update
|
||||
|
||||
-- Jeremy Soller <jeremy@system76.com> Tue, 09 Jun 2026 10:25:21 -0600
|
||||
|
||||
cosmic-edit (1.0.15) noble; urgency=medium
|
||||
|
||||
* Epoch 1.0.15 version update
|
||||
|
||||
-- Jeremy Soller <jeremy@system76.com> Tue, 02 Jun 2026 11:02:06 -0600
|
||||
|
||||
cosmic-edit (1.0.14) noble; urgency=medium
|
||||
|
||||
* Epoch 1.0.14 version update
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Exec=cosmic-edit %F
|
|||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
MimeType=text/plain;
|
||||
MimeType=text/plain;application/x-zerosize;
|
||||
Icon=com.system76.CosmicEdit
|
||||
Categories=COSMIC;Utility;TextEditor;
|
||||
Keywords=Text;Editor;
|
||||
|
|
@ -26,6 +26,9 @@ pub fn key_binds() -> HashMap<KeyBind, Action> {
|
|||
bind!([Ctrl], Key::Character("f".into()), Find);
|
||||
bind!([Ctrl], Key::Character("h".into()), FindAndReplace);
|
||||
bind!([Ctrl], Key::Character("v".into()), Paste);
|
||||
bind!([Shift], Key::Named(Named::Insert), Paste);
|
||||
bind!([Ctrl], Key::Named(Named::Insert), Copy);
|
||||
bind!([Shift], Key::Named(Named::Delete), Cut);
|
||||
bind!([Ctrl], Key::Character("t".into()), NewFile);
|
||||
bind!([Ctrl], Key::Character("n".into()), NewWindow);
|
||||
bind!([Ctrl], Key::Character("o".into()), OpenFileDialog);
|
||||
|
|
|
|||
50
src/main.rs
50
src/main.rs
|
|
@ -691,13 +691,7 @@ impl App {
|
|||
return Some(NewTab::Exists(entity));
|
||||
}
|
||||
|
||||
// Add to recent files, ensuring only one entry
|
||||
self.config_state.recent_files.retain(|x| x != &canonical);
|
||||
self.config_state
|
||||
.recent_files
|
||||
.push_front(canonical.to_path_buf());
|
||||
self.config_state.recent_files.truncate(10);
|
||||
self.save_config_state();
|
||||
self.add_to_recents(&canonical);
|
||||
|
||||
let mut tab = EditorTab::new(&self.config);
|
||||
tab.open(canonical);
|
||||
|
|
@ -707,6 +701,15 @@ impl App {
|
|||
}
|
||||
}
|
||||
|
||||
fn add_to_recents(&mut self, canonical: &PathBuf) {
|
||||
self.config_state.recent_files.retain(|x| x != canonical);
|
||||
self.config_state
|
||||
.recent_files
|
||||
.push_front(canonical.to_path_buf());
|
||||
self.config_state.recent_files.truncate(10);
|
||||
self.save_config_state();
|
||||
}
|
||||
|
||||
fn update_config(&mut self) -> Task<Message> {
|
||||
//TODO: provide iterator over data
|
||||
let entities: Vec<_> = self.tab_model.iter().collect();
|
||||
|
|
@ -2587,11 +2590,18 @@ impl Application for App {
|
|||
|
||||
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
|
||||
if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) {
|
||||
if tab.path_opt.is_none() {
|
||||
return self.update(Message::SaveAsDialog(Some(entity)));
|
||||
match tab.path_opt.clone() {
|
||||
Some(path) => {
|
||||
title_opt = Some(tab.title());
|
||||
tab.save();
|
||||
if let Ok(canonical) = fs::canonicalize(&path) {
|
||||
self.add_to_recents(&canonical);
|
||||
}
|
||||
}
|
||||
None => {
|
||||
return self.update(Message::SaveAsDialog(Some(entity)));
|
||||
}
|
||||
}
|
||||
title_opt = Some(tab.title());
|
||||
tab.save();
|
||||
}
|
||||
if let Some(title) = title_opt {
|
||||
self.tab_model.text_set(self.tab_model.active(), title);
|
||||
|
|
@ -2602,10 +2612,17 @@ impl Application for App {
|
|||
let entities: Vec<_> = self.tab_model.iter().collect();
|
||||
for entity in entities {
|
||||
if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) {
|
||||
if tab.path_opt.is_none() {
|
||||
log::warn!("{} has no path when doing save all", tab.title());
|
||||
match tab.path_opt.clone() {
|
||||
Some(path) => {
|
||||
tab.save();
|
||||
if let Ok(canonical) = fs::canonicalize(&path) {
|
||||
self.add_to_recents(&canonical);
|
||||
}
|
||||
}
|
||||
None => {
|
||||
log::warn!("{} has no path when doing save all", tab.title());
|
||||
}
|
||||
}
|
||||
tab.save();
|
||||
}
|
||||
}
|
||||
return self.update_dialogs();
|
||||
|
|
@ -2649,6 +2666,11 @@ impl Application for App {
|
|||
tab.path_opt = Some(paths.remove(0));
|
||||
title_opt = Some(tab.title());
|
||||
tab.save();
|
||||
if let Some(path) = tab.path_opt.clone() {
|
||||
if let Ok(canonical) = fs::canonicalize(&path) {
|
||||
self.add_to_recents(&canonical);
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(title) = title_opt {
|
||||
self.tab_model.text_set(entity, title);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue