import { fn } from "https://deno.land/x/ddu_vim@v4.0.0/deps.ts";
const { sign_getplaced } = fn;
Return a list of signs placed in a buffer or all the buffers.
This is similar to the :sign-place-list
command.
If the optional buffer name {buf} is specified, then only the
list of signs placed in that buffer is returned. For the use
of {buf}, see bufname()
. The optional {dict} can contain
the following entries:
group select only signs in this group
id select sign with this identifier
lnum select signs placed in this line. For the use
of {lnum}, see line()
.
If {group} is '*', then signs in all the groups including the
global group are returned. If {group} is not supplied or is an
empty string, then only signs in the global group are
returned. If no arguments are supplied, then signs in the
global group placed in all the buffers are returned.
See sign-group
.
Each list item in the returned value is a dictionary with the following entries: bufnr number of the buffer with the sign signs list of signs placed in {bufnr}. Each list item is a dictionary with the below listed entries
The dictionary for each sign contains the following entries: group sign group. Set to '' for the global group. id identifier of the sign lnum line number where the sign is placed name name of the defined sign priority sign priority
The returned signs in a buffer are ordered by their line number and priority.
Returns an empty list on failure or if there are no placed signs.
Examples:
" Get a List of signs placed in eval.c in the
" global group
echo sign_getplaced("eval.c")
" Get a List of signs in group 'g1' placed in eval.c
echo sign_getplaced("eval.c", {'group' : 'g1'})
" Get a List of signs placed at line 10 in eval.c
echo sign_getplaced("eval.c", {'lnum' : 10})
" Get sign with identifier 10 placed in a.py
echo sign_getplaced("a.py", {'id' : 10})
" Get sign with id 20 in group 'g1' placed in a.py
echo sign_getplaced("a.py", {'group' : 'g1',
\ 'id' : 20})
" Get a List of all the placed signs
echo sign_getplaced()
Can also be used as a method
:
GetBufname()->sign_getplaced()