import { fn } from "https://deno.land/x/ddu_vim@v4.0.0/deps.ts";
const { sign_place } = fn;
Place the sign defined as {name} at line {lnum} in file or
buffer {buf} and assign {id} and {group} to sign. This is
similar to the :sign-place
command.
If the sign identifier {id} is zero, then a new identifier is
allocated. Otherwise the specified number is used. {group} is
the sign group name. To use the global sign group, use an
empty string. {group} functions as a namespace for {id}, thus
two groups can use the same IDs. Refer to sign-identifier
and sign-group
for more information.
{name} refers to a defined sign.
{buf} refers to a buffer name or number. For the accepted
values, see bufname()
.
The optional {dict} argument supports the following entries:
lnum line number in the file or buffer
{buf} where the sign is to be placed.
For the accepted values, see line()
.
priority priority of the sign. See
sign-priority
for more information.
If the optional {dict} is not specified, then it modifies the placed sign {id} in group {group} to use the defined sign {name}.
Returns the sign identifier on success and -1 on failure.
Examples:
" Place a sign named sign1 with id 5 at line 20 in
" buffer json.c
call sign_place(5, '', 'sign1', 'json.c',
\ {'lnum' : 20})
" Updates sign 5 in buffer json.c to use sign2
call sign_place(5, '', 'sign2', 'json.c')
" Place a sign named sign3 at line 30 in
" buffer json.c with a new identifier
let id = sign_place(0, '', 'sign3', 'json.c',
\ {'lnum' : 30})
" Place a sign named sign4 with id 10 in group 'g3'
" at line 40 in buffer json.c with priority 90
call sign_place(10, 'g3', 'sign4', 'json.c',
\ {'lnum' : 40, 'priority' : 90})
Can also be used as a method
:
GetSignid()->sign_place(group, name, expr)