Skip to content

Commit 324148f

Browse files
authored
Make the input history of each provider persisted and add experimental winbar support (#1034)
* provider: make input history persistent * Add winbar support in ctags plugin * Reset winbar if no symbol is found * Escape item in winbar in case it contains whitespaces * Pass winbar directly * Display file path in winbar * Display file path in winbar * Shrink path if needed * Remove icon for full path * Separate winbar config * Split config module from maple_core * Rename config_gen to doc_gen and move it into maple_config folder * Upgrade criterion to 0.5 * Update CHANGELOG.md
1 parent 9bc974e commit 324148f

File tree

29 files changed

+473
-70
lines changed

29 files changed

+473
-70
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
## [unreleased]
44

5+
## Added
6+
7+
- Input history of providers are now persistent.
8+
- Added experimental winbar support (neovim-only).
9+
```
10+
[winbar]
11+
enable = true
12+
```
13+
14+
## Fixed
15+
16+
- Make the behaviour on empty query consistent across the providers.
517

618
## [0.50] 2024-01-02
719

Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ python-dynamic-module:
99
cd pythonx/clap && $(MAKE_CMD) build
1010

1111
config-md:
12-
cd crates/config_gen && cargo run
12+
cd crates/maple_config/doc_gen && cargo run
1313

1414
clippy:
1515
cd crates && cargo clippy --workspace --all-features --all-targets -- -D warnings

autoload/clap/api.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ else
3737
endfunction
3838
endif
3939

40+
function! clap#api#update_winbar(winid, winbar) abort
41+
if empty(a:winbar)
42+
let l:winbar = ''
43+
else
44+
let l:winbar = escape(a:winbar, ' ')
45+
endif
46+
call clap#api#win_execute(a:winid, 'setlocal winbar='.l:winbar)
47+
endfunction
48+
4049
let s:api = {}
4150

4251
if s:is_nvim

crates/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ members = [
88
"icon",
99
"cli",
1010
"ide",
11+
"maple_config",
12+
"maple_config/doc_gen",
1113
"maple_core",
1214
"maple_derive",
1315
"maple_lsp",
@@ -36,6 +38,7 @@ chrono = { version = "0.4", features = ["serde"] }
3638
chrono-humanize = "0.2.3"
3739
clap = { version = "4.2", features = ["derive"] }
3840
colors-transform = "0.2.11"
41+
criterion = "0.5"
3942
directories = "4.0"
4043
futures = "0.3"
4144
fuzzy-matcher = "0.3"
@@ -77,6 +80,7 @@ dumb_analyzer = { path = "./dumb_analyzer" }
7780
filter = { path = "./filter" }
7881
icon = { path = "./icon" }
7982
ide = { path = "./ide" }
83+
maple_config = { path = "./maple_config" }
8084
maple_core = { path = "./maple_core" }
8185
maple_derive = { path = "./maple_derive" }
8286
maple_lsp = { path = "./maple_lsp" }

crates/cli/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ tracing-subscriber = { workspace = true, features = ["env-filter"] }
2727
filter = { workspace = true }
2828
icon = { workspace = true }
2929
matcher = { workspace = true }
30+
maple_config = { workspace = true }
3031
maple_core = { workspace = true }
3132
pattern = { workspace = true }
3233
printer = { workspace = true }
3334
types = { workspace = true }
3435
utils = { workspace = true }
3536

3637
[dev-dependencies]
37-
criterion = "0.3"
38+
criterion = { workspace = true }
3839

3940
[[bench]]
4041
name = "benchmark"

crates/cli/src/command/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Rpc;
1212
impl Rpc {
1313
pub async fn run(&self, args: Args) -> Result<()> {
1414
let (config, maybe_toml_err) =
15-
maple_core::config::load_config_on_startup(args.config_file.clone());
15+
maple_config::load_config_on_startup(args.config_file.clone());
1616

1717
let maybe_log = if let Some(log_path) = args.log {
1818
Some(log_path)

crates/maple_config/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "maple_config"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
dirs = { workspace = true }
8+
once_cell = { workspace = true }
9+
serde = { workspace = true }
10+
toml = { workspace = true }
11+
12+
paths = { workspace = true }
13+
types = { workspace = true }
File renamed without changes.

crates/config_gen/Cargo.toml renamed to crates/maple_config/doc_gen/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[package]
2-
name = "config_gen"
2+
name = "doc_gen"
33
version = "0.1.0"
44
edition = "2021"
5+
description = "Generate config markdown document from the inline docs"
56

67
[dependencies]
78
inflections = "1.1.1"
8-
maple_core = { path = "../maple_core" }
9+
maple_config = { path = "../" }
10+
maple_core = { path = "../../maple_core" }
911
toml = "0.5"
1012
syn = { version = "1", features = ["full"] }
1113
quote = "1"

0 commit comments

Comments
 (0)