Skip to content
t9md edited this page Feb 28, 2017 · 24 revisions

Term and Roles

  • narrow-editor or narrow-ui: handles user input and update item list.
  • narrow-provider: Provide items to narrow and action to jump to item selected.

Flow of startup

  1. User invoke narrow:scan
  2. Instantiate Scan provider and instantiate Ui to use for this provider.
  3. Open narrow-editor( Ui hold narrow-editor and control-bar etc..).

Narrow query

Text you input on first line of narrow-editor.

  • Items in narrow-editor are filtered by query.
  • Basically query is mached as-is( No regular expression support currently ).
  • Can chain multiple query separating by whilte-space.
    • e.g. foo bar means, select items matches foo and bar.
  • * is treated as wildcard, internally converted to .* regular expression.
  • ! is treated as nagate, !foo means 'not matching foo'.
    • If config negateNarrowQueryByEndingExclamation set to true, you can also use foo!.
  • Query case sensitivity is configurable with config caseSensitivityForNarrowQuery.
    • Can override global setting on each provider if you want.
  • See also this issue

Built-in provider

scan

  • Scan current editor( use editor.scan under the hood )
  • It use first narrow query as search term( first word separated by white-spaces on query text ).
  • Rest of include and exclude(! starting word) queries are treated as normal filter query.
  • To make this exceptional query handling obvious by eye, use different syntax grammar highlight for first query(= scan term).

search

  • Search by ag( you need to install ag by yourself).
  • Need to install ag by yourself.

atom-scan

  • Similar to search but use Atom's atom.workspace.scan.

fold

  • Provide fold-starting rows as item.
  • Can change fold level to show up on narrow-editor by
    • narrow-ui:fold:increase-fold-level
    • narrow-ui:fold:decrease-fold-level

git-diff

  • Show git-diff for current active-editor. Info source is core git-diff package.

git-diff-all

  • Show all modified state file across project.
  • If you are comfortable with this provider, you don't need git-diff at all( like me ).

bookmarks

  • Info source is core bookmarks package
  • This is toy, I don't use bookmarks feature heavily.

symbols

  • Provide symbols for current file.
  • Useful to quick previewing function definition on same file.

project-symbols

  • Provide project-wide symbols information by reading tags file.

linter

  • Use message provided by linter package.
Clone this wiki locally