option' = string "option" >> ws >> OptionAnnotation <$> optionName <*> optionType <*> optionDefault
optionName = many1 (alphaNum <|> char ':') <* ws <?> "option name"
optionType = many1 alphaNum <* optional ws <?> "option type"
- optionDefault = optionMaybe word <?> "option default value"
+ optionDefault = optionMaybe $ many1 (noneOf "\n")
plugin = string "plugin" >> ws >> PluginAnnotation <$> pluginName <*> plugInDescription
pluginName = many1 (alphaNum <|> char '-') <* ws
{ letLexpr = "l:prefix"
, letValue = "'c' \" Will use cexpr, cgetexpr."
}
+ , Empty
, LetStatement
{ letLexpr = "l:handler"
, letValue = "get(g:, 'FerretQFHandler', 'botright copen')"
{ letLexpr = "l:prefix"
, letValue = "'l' \" Will use lexpr, lgetexpr."
}
+ , Empty
, LetStatement
{ letLexpr = "l:handler"
, letValue = "get(g:, 'FerretLLHandler', 'lopen')"
, Plaintext "\"bar\":"
]
, Fenced [ ":Acks /\\v(foo\\d+)(bar)/\\2\\1/" ]
+ , CommandAnnotation "FerretCancelAsync" Nothing
+ , Paragraph
+ [ Plaintext "Cancels"
+ , Whitespace
+ , Plaintext "any"
+ , Whitespace
+ , Plaintext "asynchronous"
+ , Whitespace
+ , Plaintext "search"
+ , Whitespace
+ , Plaintext "that"
+ , Whitespace
+ , Plaintext "may"
+ , Whitespace
+ , Plaintext "be"
+ , Whitespace
+ , Plaintext "in"
+ , Whitespace
+ , Plaintext "progress"
+ , Whitespace
+ , Plaintext "in"
+ , Whitespace
+ , Plaintext "the"
+ , Whitespace
+ , Plaintext "background."
+ ]
+ , CommandAnnotation "FerretPullAsync" Nothing
+ , Paragraph
+ [ Plaintext "Eagerly"
+ , Whitespace
+ , Plaintext "populates"
+ , Whitespace
+ , Plaintext "the"
+ , Whitespace
+ , Link "quickfix"
+ , Whitespace
+ , Plaintext "(or"
+ , Whitespace
+ , Link "location-list"
+ , Plaintext ")"
+ , Whitespace
+ , Plaintext "window"
+ , Whitespace
+ , Plaintext "with"
+ , Whitespace
+ , Plaintext "any"
+ , Whitespace
+ , Plaintext "results"
+ , Whitespace
+ , Plaintext "that"
+ , Whitespace
+ , Plaintext "may"
+ , Whitespace
+ , Plaintext "have"
+ , Whitespace
+ , Plaintext "been"
+ , Whitespace
+ , Plaintext "produced"
+ , Whitespace
+ , Plaintext "by"
+ , Whitespace
+ , Plaintext "a"
+ , Whitespace
+ , Plaintext "long-running"
+ , Whitespace
+ , Plaintext "asynchronoous"
+ , Whitespace
+ , Plaintext "search"
+ , Whitespace
+ , Plaintext "in"
+ , Whitespace
+ , Plaintext "progress"
+ , Whitespace
+ , Plaintext "in"
+ , Whitespace
+ , Plaintext "the"
+ , Whitespace
+ , Plaintext "background."
+ ]
, CommandAnnotation "Qargs" Nothing
, Paragraph
[ Plaintext "This"
, Paragraph
[ Plaintext "Example" , Whitespace , Plaintext "override:" ]
, Fenced [ "let g:FerretAutojump=2" ]
+ , OptionAnnotation
+ "g:FerretQFHandler" "string" (Just "\"botright copen\"")
+ , Paragraph
+ [ Plaintext "Allows"
+ , Whitespace
+ , Plaintext "you"
+ , Whitespace
+ , Plaintext "to"
+ , Whitespace
+ , Plaintext "override"
+ , Whitespace
+ , Plaintext "the"
+ , Whitespace
+ , Plaintext "mechanism"
+ , Whitespace
+ , Plaintext "that"
+ , Whitespace
+ , Plaintext "opens"
+ , Whitespace
+ , Plaintext "the"
+ , Whitespace
+ , Link "quickfix"
+ , Whitespace
+ , Plaintext "window"
+ , Whitespace
+ , Plaintext "to"
+ , Whitespace
+ , Plaintext "display"
+ , Whitespace
+ , Plaintext "search"
+ , Whitespace
+ , Plaintext "results."
+ ]
+ , OptionAnnotation "g:FerretLLHandler" "string" (Just "\"lopen\"")
+ , Paragraph
+ [ Plaintext "Allows"
+ , Whitespace
+ , Plaintext "you"
+ , Whitespace
+ , Plaintext "to"
+ , Whitespace
+ , Plaintext "override"
+ , Whitespace
+ , Plaintext "the"
+ , Whitespace
+ , Plaintext "mechanism"
+ , Whitespace
+ , Plaintext "that"
+ , Whitespace
+ , Plaintext "opens"
+ , Whitespace
+ , Plaintext "the"
+ , Whitespace
+ , Link "location-list"
+ , Whitespace
+ , Plaintext "window"
+ , Whitespace
+ , Plaintext "to"
+ , Whitespace
+ , Plaintext "display"
+ , Whitespace
+ , Plaintext "search"
+ , Whitespace
+ , Plaintext "results."
+ ]
, OptionAnnotation "g:FerretQFOptions" "boolean" (Just "1")
, Paragraph
[ Plaintext "Controls"
:Acks /\v(foo\d+)(bar)/\2\1/
```
+<p align="right"><a name="ferretcancelasync" href="#user-content-ferretcancelasync"><code>:FerretCancelAsync</code></a></p>
+
+### `:FerretCancelAsync`<a name="ferret-ferretcancelasync" href="#user-content-ferret-ferretcancelasync"></a>
+
+Cancels any asynchronous search that may be in progress in the background.
+
+<p align="right"><a name="ferretpullasync" href="#user-content-ferretpullasync"><code>:FerretPullAsync</code></a></p>
+
+### `:FerretPullAsync`<a name="ferret-ferretpullasync" href="#user-content-ferret-ferretpullasync"></a>
+
+Eagerly populates the <strong>`quickfix`</strong> (or <strong>`location-list`</strong>) window with any results that may have been produced by a long-running asynchronoous search in progress in the background.
+
<p align="right"><a name="qargs" href="#user-content-qargs"><code>:Qargs</code></a></p>
### `:Qargs`<a name="ferret-qargs" href="#user-content-ferret-qargs"></a>
let g:FerretAutojump=2
```
+<p align="right"><a name="gferretqfhandler" href="#user-content-gferretqfhandler"><code>g:FerretQFHandler</code></a></p>
+
+### `g:FerretQFHandler` (string, default: "botright copen")<a name="ferret-gferretqfhandler-string-default-botright-copen" href="#user-content-ferret-gferretqfhandler-string-default-botright-copen"></a>
+
+Allows you to override the mechanism that opens the <strong>`quickfix`</strong> window to display search results.
+
+<p align="right"><a name="gferretllhandler" href="#user-content-gferretllhandler"><code>g:FerretLLHandler</code></a></p>
+
+### `g:FerretLLHandler` (string, default: "lopen")<a name="ferret-gferretllhandler-string-default-lopen" href="#user-content-ferret-gferretllhandler-string-default-lopen"></a>
+
+Allows you to override the mechanism that opens the <strong>`location-list`</strong> window to display search results.
+
<p align="right"><a name="gferretqfoptions" href="#user-content-gferretqfoptions"><code>g:FerretQFOptions</code></a></p>
### `g:FerretQFOptions` (boolean, default: 1)<a name="ferret-gferretqfoptions-boolean-default-1" href="#user-content-ferret-gferretqfoptions-boolean-default-1"></a>
### 1.2a (16 May 2016)<a name="ferret-12a-16-may-2016" href="#user-content-ferret-12a-16-may-2016"></a>
-- Add optional support for running searches asynchronously using Vim's <strong>`+job`</strong> feature (enabled by default in sufficiently recent versions of Vim); see <strong>[`g:FerretJob`](#user-content-gferretjob)</strong>, <strong>`:FerretCancelAsync`</strong> and <strong>`:FerretPullAsync`</strong>.
+- Add optional support for running searches asynchronously using Vim's <strong>`+job`</strong> feature (enabled by default in sufficiently recent versions of Vim); see <strong>[`g:FerretJob`](#user-content-gferretjob)</strong>, <strong>[`:FerretCancelAsync`](#user-content-ferretcancelasync)</strong> and <strong>[`:FerretPullAsync`](#user-content-ferretpullasync)</strong>.
### 1.1.1 (7 March 2016)<a name="ferret-111-7-march-2016" href="#user-content-ferret-111-7-march-2016"></a>
### 1.0 (28 December 2015)<a name="ferret-10-28-december-2015" href="#user-content-ferret-10-28-december-2015"></a>
- Fix broken <strong>[`:Qargs`](#user-content-qargs)</strong> command (patch from Daniel Silva).
-- Add <strong>`g:FerretQFHandler`</strong> and <strong>`g:FerretLLHandler`</strong> options (patch from Daniel Silva).
+- Add <strong>[`g:FerretQFHandler`](#user-content-gferretqfhandler)</strong> and <strong>[`g:FerretLLHandler`](#user-content-gferretllhandler)</strong> options (patch from Daniel Silva).
- Make <strong>`<Plug>`</strong> mappings accessible even <strong>[`g:FerretMap`](#user-content-gferretmap)</strong> is set to 0.
- Fix failure to report filename when using `ack` and explicitly scoping search to a single file (patch from Daniel Silva).
- When using `ag`, report multiple matches per line instead of just the first (patch from Daniel Silva).
>
:Acks /\v(foo\d+)(bar)/\2\1/
<
+ *:FerretCancelAsync*
+:FerretCancelAsync ~
+
+Cancels any asynchronous search that may be in progress in the background.
+
+ *:FerretPullAsync*
+:FerretPullAsync ~
+
+Eagerly populates the |quickfix| (or |location-list|) window with any results
+that may have been produced by a long-running asynchronoous search in
+progress in the background.
+
*:Qargs*
:Qargs ~
let g:FerretAutojump=2
<
+ *g:FerretQFHandler*
+|g:FerretQFHandler| string (default: "botright copen")
+
+Allows you to override the mechanism that opens the |quickfix| window to
+display search results.
+
+
+ *g:FerretLLHandler*
+|g:FerretLLHandler| string (default: "lopen")
+
+Allows you to override the mechanism that opens the |location-list| window to
+display search results.
+
+
*g:FerretQFOptions*
|g:FerretQFOptions| boolean (default: 1)
let l:autojump=s:autojump()
if a:ack
let l:prefix='c' " Will use cexpr, cgetexpr.
+ ""
+ " @option g:FerretQFHandler string "botright copen"
+ "
+ " Allows you to override the mechanism that opens the |quickfix| window to
+ " display search results.
+ "
let l:handler=get(g:, 'FerretQFHandler', 'botright copen')
let l:post='qf'
else
let l:prefix='l' " Will use lexpr, lgetexpr.
+ ""
+ " @option g:FerretLLHandler string "lopen"
+ "
+ " Allows you to override the mechanism that opens the |location-list|
+ " window to display search results.
+ "
let l:handler=get(g:, 'FerretLLHandler', 'lopen')
let l:post='location'
endif
" :Acks /\v(foo\d+)(bar)/\2\1/
" ```
command! -nargs=1 Acks call ferret#private#acks(<q-args>)
+
+""
+" @command :FerretCancelAsync
+"
+" Cancels any asynchronous search that may be in progress in the background.
+"
command! FerretCancelAsync call ferret#private#async#cancel()
+
+""
+" @command :FerretPullAsync
+"
+" Eagerly populates the |quickfix| (or |location-list|) window with any results
+" that may have been produced by a long-running asynchronoous search in progress
+" in the background.
+"
command! FerretPullAsync call ferret#private#async#pull()
nnoremap <Plug>(FerretAck) :Ack<space>