Skip to content

Commit 3222569

Browse files
committed
fix name of hit; bump 0.0.6
1 parent b030fda commit 3222569

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Demo http://repo.mvc-works.org/fuzzy-filter/
1111
[![Clojars Project](https://img.shields.io/clojars/v/mvc-works/fuzzy-filter.svg)](https://clojars.org/mvc-works/fuzzy-filter)
1212

1313
```edn
14-
[mvc-works/fuzzy-filter "0.0.5"]
14+
[mvc-works/fuzzy-filter "0.0.6"]
1515
```
1616

1717
```edn
@@ -21,17 +21,17 @@ Demo http://repo.mvc-works.org/fuzzy-filter/
2121

2222
```clojure
2323
(parse-by-letter "this and that to search" "that search")
24-
; => {:matches? false, :chunks [[:hitted "th"] [:rest "is "] [:hitted "a"] [:rest "nd "] [:hitted "t"] [:space "h"] [:rest "at to "] [:hitted "searc"] [:rest "h"] [:missed "g"]], :text "this and that to search"}
24+
; => {:matches? false, :chunks [[:hit "th"] [:rest "is "] [:hit "a"] [:rest "nd "] [:hit "t"] [:space "h"] [:rest "at to "] [:hit "searc"] [:rest "h"] [:missed "g"]], :text "this and that to search"}
2525

26-
(parse-by-word "this and that to search" "that search")
27-
; => {:matches? false, :chunks [[:rest "this and "] [:hitted "that"] [:missed "searcg"]], :text "this and that to search"}
26+
(parse-by-word "this and that to search" "that searcH")
27+
; => {:matches? false, :chunks [[:rest "this and "] [:hit "that"] [:missed "searcH"]], :text "this and that to search"}
2828

2929
(comp-visual (:sequences result) {:style-rest {:color (hsl 0 0 70)}}))))
3030
```
3131

3232
```clojure
3333
:style-base
34-
:style-hitted
34+
:style-hit
3535
:style-rest
3636
```
3737

calcit.edn

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

meyvn.edn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{:pom {:group-id "mvc-works",
33
:artifact-id "fuzzy-filter",
4-
:version "0.0.5",
4+
:version "0.0.6",
55
:name "A customzed fuzzy search function"}
66
:packaging {:jar {:enabled true
77
:remote-repository {:id "clojars"

src/fuzzy_filter/comp/visual.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
{:inner-text (last chunk),
2222
:style (merge
2323
(:style-base options)
24-
(if (= :hitted (first chunk))
25-
(merge {:font-weight :bold} (:style-hitted options))
24+
(if (= :hit (first chunk))
25+
(merge {:font-weight :bold} (:style-hit options))
2626
(:style-rest options)))})])))))

src/fuzzy_filter/core.cljs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(if (empty? xs)
2626
(conj acc [:missed (apply str ys)])
2727
(if (= (first xs) (first ys))
28-
(recur (conj acc [:hitted (first xs)]) (rest xs) (rest ys))
28+
(recur (conj acc [:hit (first xs)]) (rest xs) (rest ys))
2929
(if (= " " (first ys))
3030
(recur (conj acc [:space (first xs)]) (rest xs) (rest ys))
3131
(recur (conj acc [:rest (first xs)]) (rest xs) ys)))))))
@@ -46,8 +46,8 @@
4646
(cond
4747
(pos? p)
4848
(recur
49-
(conj acc [:rest (subs text 0 p)] [:hitted y0])
49+
(conj acc [:rest (subs text 0 p)] [:hit y0])
5050
(subs text (+ p (count y0)))
5151
(rest ys))
52-
(zero? p) (recur (conj acc [:hitted y0]) (subs text (count y0)) (rest ys))
52+
(zero? p) (recur (conj acc [:hit y0]) (subs text (count y0)) (rest ys))
5353
:else (conj acc [:missed y0]))))))

0 commit comments

Comments
 (0)