Skip to content

The CAN search command should fuzzy search all note contentΒΆ

CAN's search command should search the text content of all notes with the string provided. The results should list each note that has matching text. Each note listed should have a title first, followed by every line which contains a match within that note. The sections which match directly should be highlighted.

For now, only the top three notes with matches should be displayed. In the future, a small search mode will be installed with the ability to page through results.

In order to ease implementation, the plain text searched through will be rendered markdown. This will make for some strange possibilities, like searching for '#' to get headers - but it's much simpler than the alternative of having to construct context manually from the AST (at least for now). This will be reviewed over time.

The search command should fire a COMMAND_SEARCH event. The search-notes handler should listen for this event and collect the current notes text for searching and rendering. Fuse.js will be used to perform the search.