Commit 7867eb0
fix: Move thorough search through search.filters w/ workspaces (#2703)
Do not just pick first from search.filters, consider all options,
filtering based on git-root and workspaces config
Fix: #2700
Might Fix: #2536
Wrote a few simple unit tests, and tried it by running the client
locally. Not sure about which of "[search] filters" vs "workspaces"
should be more respected, so i made it so if workspaces = false,
regardless of whats in "[search] filters" workspace gets filtered out.
First time looking at atuins code, let me know if this needs any
changes.
edit: (from my post here:
#2536 (comment))
```
workspaces = true
[search]
filters = [ "workspace", "directory", "session", "global" ]
```
| `^R` for the ... time| in a git repo | any other dir|
| ------------- | ------------- | ------------- |
| first | workspace | directory|
| second | directory | session|
| third| session | global|
| fourth | global | directory |
| fifth | workspace | session|
| sixth | directory | global |

<!-- Thank you for making a PR! Bug fixes are always welcome, but if
you're adding a new feature or changing an existing one, we'd really
appreciate if you open an issue, post on the forum, or drop in on
Discord -->
## Checks
- [X] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [X] I have checked that there are no existing pull requests for the
same thing
- #1655 might be related, but it seems to also implement code that is
already merged, and has been open for over a year, hope its ok to
suggest this
---------
Co-authored-by: Michelle Tilley <[email protected]>1 parent 2ba93a8 commit 7867eb0
File tree
5 files changed
+74
-11
lines changed- crates
- atuin-client/src
- atuin/src/command/client
- search
5 files changed
+74
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
742 | 752 | | |
743 | 753 | | |
744 | 754 | | |
| |||
979 | 989 | | |
980 | 990 | | |
981 | 991 | | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
982 | 1046 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
518 | 521 | | |
519 | 522 | | |
520 | 523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
1260 | 1258 | | |
1261 | 1259 | | |
1262 | 1260 | | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
| 1261 | + | |
1266 | 1262 | | |
1267 | 1263 | | |
1268 | 1264 | | |
| |||
0 commit comments