Skip to content

Commit

Permalink
preparing for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jul 26, 2023
1 parent 676d798 commit 0966fb8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ features listed below may be missing from your installation.
```
$ cs -h
code spelunker (cs) code search.
Version 1.2.0
Version 1.3.0
Ben Boyter <[email protected]>
cs recursively searches the current directory using some boolean logic
Expand All @@ -138,8 +138,16 @@ Searches by default use AND boolean syntax for all terms
- negate using NOT such as pride NOT prejudice
- regex with toothpick syntax /pr[e-i]de/
Searches can fuzzy match which files are searched by adding
the following syntax
- test file:test
- stuff filename:.go
Files that are searched will be limited to those that fuzzy
match test for the first example and .go for the second.
Example search that uses all current functionality
- darcy NOT collins wickham~1 "ten thousand a year" /pr[e-i]de/
- darcy NOT collins wickham~1 "ten thousand a year" /pr[e-i]de/ file:test
The default input field in tui mode supports some nano commands
- CTRL+a move to the beginning of the input
Expand Down Expand Up @@ -182,7 +190,7 @@ You can do exact match with quotes, and do regular expressions using toothpicks.
Example search that uses all current functionality

```shell
cs t NOT something test~1 "ten thousand a year" "/pr[e-i]de/"
cs t NOT something test~1 "ten thousand a year" "/pr[e-i]de/" file:test
```

You can use it in a similar manner to `fzf` in TUI mode if you like, since `cs` will return the matching document path
Expand Down
3 changes: 2 additions & 1 deletion file.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import (

var dirFilePaths = []string{}
var searchToFileMatchesCache = map[string][]string{}
var searchToFileMatchesCacheMutex = sync.Mutex{}

//var searchToFileMatchesCacheMutex = sync.Mutex{}

func FindFiles(query string) chan *gocodewalker.File {
// TODO enable this again as it seems to have issues
Expand Down
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func StartHttpServer() {
summaryQueue := make(chan *FileJob, runtime.NumCPU()) // Files that match and need to be displayed

q, fuzzy := PreParseQuery(strings.Fields(query))

fileReaderWorker := NewFileReaderWorker(files, toProcessQueue)
fileReaderWorker.FuzzyMatch = fuzzy
fileSearcher := NewSearcherWorker(toProcessQueue, summaryQueue)
Expand Down
13 changes: 11 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

const (
Version = "1.2.0"
Version = "1.3.0"
)

func main() {
Expand All @@ -36,8 +36,17 @@ func main() {
" - negate using NOT such as pride NOT prejudice\n" +
" - regex with toothpick syntax /pr[e-i]de/\n" +
"\n" +
"Searches can fuzzy match which files are searched by adding\n" +
"the following syntax\n" +
"\n" +
" - test file:test\n" +
" - stuff filename:.go\n" +
"\n" +
"Files that are searched will be limited to those that fuzzy\n" +
"match test for the first example and .go for the second." +
"\n" +
"Example search that uses all current functionality\n" +
" - darcy NOT collins wickham~1 \"ten thousand a year\" /pr[e-i]de/\n" +
" - darcy NOT collins wickham~1 \"ten thousand a year\" /pr[e-i]de/ file:test\n" +
"\n" +
"The default input field in tui mode supports some nano commands\n" +
"- CTRL+a move to the beginning of the input\n" +
Expand Down

0 comments on commit 0966fb8

Please sign in to comment.