Skip to content

Commit

Permalink
Implement project search in context drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Nov 29, 2023
1 parent 8996394 commit 7b0d597
Show file tree
Hide file tree
Showing 10 changed files with 469 additions and 15 deletions.
142 changes: 140 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ license = "GPL-3.0-only"

[dependencies]
env_logger = "0.10.0"
grep = "0.3.1"
ignore = "0.4.21"
lazy_static = "1.4.0"
log = "0.4.20"
notify = "6.1.1"
Expand All @@ -30,7 +32,7 @@ features = ["syntect", "vi"]
[dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic"
default-features = false
features = ["tokio", "winit", "wgpu"]
features = ["tokio", "winit"]
#path = "../libcosmic"

#TODO: clean up and send changes upstream
Expand Down
6 changes: 5 additions & 1 deletion i18n/en/cosmic_edit.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ character-count = Characters
character-count-no-spaces = Characters (without spaces)
line-count = Lines
## Project search
project-search = Project search
## Settings
settings = Settings
Expand Down Expand Up @@ -57,9 +60,10 @@ redo = Redo
cut = Cut
copy = Copy
paste = Paste
select-all = Select All
select-all = Select all
find = Find
replace = Replace
find-in-project = Find in project...
spell-check = Spell check...
## View
Expand Down
5 changes: 5 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-only

use cosmic::{
cosmic_config::{self, cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry},
iced::keyboard::{KeyCode, Modifiers},
Expand Down Expand Up @@ -26,6 +28,7 @@ pub enum Action {
Redo,
Save,
SelectAll,
ToggleProjectSearch,
ToggleSettingsPage,
ToggleWordWrap,
Undo,
Expand All @@ -47,6 +50,7 @@ impl Action {
Self::Redo => Message::Redo,
Self::Save => Message::Save,
Self::SelectAll => Message::SelectAll,
Self::ToggleProjectSearch => Message::ToggleContextPage(ContextPage::ProjectSearch),
Self::ToggleSettingsPage => Message::ToggleContextPage(ContextPage::Settings),
Self::ToggleWordWrap => Message::ToggleWordWrap,
Self::Undo => Message::Undo,
Expand Down Expand Up @@ -114,6 +118,7 @@ impl KeyBind {
bind!([Ctrl, Shift], Z, Redo);
bind!([Ctrl], S, Save);
bind!([Ctrl], A, SelectAll);
bind!([Ctrl, Shift], F, ToggleProjectSearch);
bind!([Ctrl], Comma, ToggleSettingsPage);
bind!([Alt], Z, ToggleWordWrap);
bind!([Ctrl], Z, Undo);
Expand Down
2 changes: 2 additions & 0 deletions src/icon_cache.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-only

use cosmic::widget::icon;
use std::collections::HashMap;

Expand Down
2 changes: 2 additions & 0 deletions src/localize.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-only

use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer,
Expand Down
Loading

0 comments on commit 7b0d597

Please sign in to comment.