Skip to content

Commit bc04f65

Browse files
committed
Update docs
1 parent b6699d3 commit bc04f65

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

autoload/codefmt.vim

+2-1
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,10 @@ function! codefmt#GetSupportedFormatters(ArgLead, CmdLine, CursorPos) abort
271271
endfunction
272272

273273
""
274+
" @public
274275
" Returns whether there is a default formatter available for the current
275276
" buffer.
276-
function! codefmt#AvailableInCurrrentBuffer() abort
277+
function! codefmt#AvailableInCurrentBuffer() abort
277278
let l:formatters = s:registry.GetExtensions()
278279
if !empty(get(b:, 'codefmt_formatter'))
279280
let l:Predicate = {f -> f.name ==# b:codefmt_formatter}

doc/codefmt.txt

+11
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,17 @@ codefmt#FormatMap({type}) *codefmt#FormatMap()*
320320
Suitable for use as 'operatorfunc'; see |g@| for details. The type is
321321
ignored since formatting only works on complete lines.
322322

323+
codefmt#FormatExpr() *codefmt#FormatExpr()*
324+
To map the builtin |gq| command to invoke codefmt, set 'formatexpr' to call
325+
this function. Example:
326+
>
327+
<
328+
set formatexpr=codefmt#FormatExpr() <
329+
330+
codefmt#AvailableInCurrentBuffer() *codefmt#AvailableInCurrentBuffer()*
331+
Returns whether there is a default formatter available for the current
332+
buffer.
333+
323334
codefmt#formatterhelpers#Format({cmd}) *codefmt#formatterhelpers#Format()*
324335
Format lines in the current buffer via a formatter invoked by {cmd}, which
325336
is a system call represented by either a |maktaba.Syscall| or any argument

0 commit comments

Comments
 (0)