Yesterday I missed a delete proc like the de() from this code:
proc de[T](s: var seq[T]; x: T) =
let p = s.find(x)
if p > 0:
delete(s, p)
proc main =
var a = @["aa", "bb", "cc"]
a.de("dd")
echo a
a.de("bb")
echo a
main()
That type of delete is available in Ruby, so one may hope for it in Nim -- well it is O(N), but maybe still OK for tiny seqs. On can easily guess that one has to use a combination of find() and delete() for that operation. But when we try to find find() proc from
https://nim-lang.org/docs/lib.html
and type in "find" it is not listed unfortunately, which is a bit confusing.
I agree, the 19 limit is very arbitrary. It was inherited from the original search box algorithm. I think it was chosen just because it looked nice on the page / didn't take up too much space.
I think a better solution might be to provide a "show more results" button that expands the box to show all the results or goes to a separate search page that just shows all results.
Thoughts?
I like the "show more results" suggestion.
Though, after clicking on that, may be the results are shown on a dedicated search results page? .. an example on my blog.
I'd really prefer doing like what github does with its search bar, see [[docgen] allow github-like search syntax · Issue #9431 · nim-lang/Nim](https://github.com/nim-lang/Nim/issues/9431)
eg:
find limit:30