From 0966fb8a4f823ba8cbe9b965f41c5dbc44f87744 Mon Sep 17 00:00:00 2001 From: Ben Boyter Date: Thu, 27 Jul 2023 08:53:44 +1000 Subject: [PATCH] preparing for next release --- README.md | 14 +++++++++++--- file.go | 3 ++- http.go | 2 +- main.go | 13 +++++++++++-- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2230fb5..b564979 100644 --- a/README.md +++ b/README.md @@ -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 cs recursively searches the current directory using some boolean logic @@ -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 @@ -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 diff --git a/file.go b/file.go index f0a9188..cb32f98 100644 --- a/file.go +++ b/file.go @@ -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 diff --git a/http.go b/http.go index 6caebe8..f4b410a 100644 --- a/http.go +++ b/http.go @@ -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) diff --git a/main.go b/main.go index c553568..ed75e2b 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( ) const ( - Version = "1.2.0" + Version = "1.3.0" ) func main() { @@ -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" +