zeal
zeal copied to clipboard
Docset-specific search doesn't work if query begins with colon
When searching within a docset (i.e. with the search term docset:query), the search fails if query begins with colons.
E.g. searching for the ::before CSS pseudo-element with css:::before:
Adding a space before the query works, e.g. css: ::before:
Added fix to the search query parsing here: https://github.com/zealdocs/zeal/pull/1700
After looking at the search query parsing code, I realised that the current behaviour is needed for searching for items that contain colons e.g. std::string. The workaround is to add a space after the first colon, so css: ::before is needed to search for ::before under the css keyword.
The problem was that I am writing a plugin that uses the zeal CLI to open pages by passing the exact identifier name. E.g. for my plugin to open the page for the ::before selector, it needs to be able to run
zeal "css: ::before"
However, because of the way the CLI parses its arguments, the spaces around the colon are stripped out. This means that the string css:::before is actually passed to the search input. I have added a PR that fixes this: https://github.com/zealdocs/zeal/pull/1701/