summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2015-10-23 20:50:41 +0200
committerSilvan Jegen <s.jegen@gmail.com>2015-10-27 21:40:57 +0100
commit99c23cce34cb18518c555ed9bb8958ba96ce22c6 (patch)
tree196a7206b594ee6ced63f7e8808bdf4dfdb7c3af
parent957ae48b0d7e2f6d0c51b78bbeff72fc9dd44b2e (diff)
Quote words in context too
If the context contains a word that matches the keyword we quote it as well.
-rw-r--r--gwic.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/gwic.go b/gwic.go
index fdefdad..a873467 100644
--- a/gwic.go
+++ b/gwic.go
@@ -79,11 +79,12 @@ func printqueue(q *queue, words chan string, kw string, left int, out chan strin
continue
}
- q.insert(fmt.Sprintf("%q", w))
+ qstr := fmt.Sprintf("%q", w)
+ q.insert(qstr)
wc := &work{c: make(chan string, 10), left: 5, done: make(chan struct{})}
- hungryhippos = feedworkers(hungryhippos, w)
+ hungryhippos = feedworkers(hungryhippos, qstr)
sl := make([]string, MAX)
copy(sl, q.q[6:])