Skip to content

Commit 28b7970

Browse files
committed
📝 Update documentation
1 parent 008fcc3 commit 28b7970

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/gin.txt

+35
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ INTERFACE |gin-interface|
1616
COMMANDS |gin-commands|
1717
VARIABLES |gin-variables|
1818
FUNCTIONS |gin-functions|
19+
COMPONENTS |gin-components|
1920
MAPPINGS |gin-mappings|
2021
ACTIONS |gin-actions|
2122

@@ -347,6 +348,40 @@ gin#action#list_actions()
347348
gin#action#gather_candidates({range})
348349
Gather and return candidates of the current buffer in {range}.
349350

351+
-----------------------------------------------------------------------------
352+
COMPONENTS *gin-components*
353+
354+
Components are |Function| that return a string for |statusline| and |tabline|.
355+
The function will never throw errors and fail silently unless the denops is
356+
running as debug mode. Note that the result of function is cached shortly to
357+
keep performance.
358+
If no {worktree} is specified or an empty string, gin tries to find one like
359+
++worktree option explained in |gin-command-options|.
360+
361+
*gin#component#branch#ascii()*
362+
*gin#component#branch#unicode()*
363+
gin#component#branch#ascii([{worktree}])
364+
gin#component#branch#unicode([{worktree}])
365+
Return an indicator string of a current and upstream branches.
366+
>
367+
set statusline+=(%{gin#component#branch#ascii()})
368+
<
369+
*gin#component#traffic#ascii()*
370+
*gin#component#traffic#unicode()*
371+
gin#component#traffic#ascii([{worktree}])
372+
gin#component#traffic#unicode([{worktree}])
373+
Return an indicator string of the number of ahead and behind commits.
374+
>
375+
set statusline+=[%{gin#component#traffic#ascii()}]
376+
<
377+
*gin#component#worktree#full()*
378+
*gin#component#worktree#name()*
379+
gin#component#worktree#full([{worktree}])
380+
gin#component#worktree#name([{worktree}])
381+
Return an indicator string of the current worktree.
382+
>
383+
set statusline+=%{gin#component#worktree#name()}
384+
<
350385
-----------------------------------------------------------------------------
351386
MAPPINGS *gin-mappings*
352387

0 commit comments

Comments
 (0)