Skip to main content
Module

x/denops_std/function/mod.ts>sign_placelist

📚 Standard module for denops.vim
Go to Latest
function sign_placelist
import { sign_placelist } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

Place one or more signs. This is similar to the sign_place() function. The {list} argument specifies the List of signs to place. Each list item is a dict with the following sign attributes: buffer Buffer name or number. For the accepted values, see bufname(). group Sign group. {group} functions as a namespace for {id}, thus two groups can use the same IDs. If not specified or set to an empty string, then the global group is used. See sign-group for more information. id Sign identifier. If not specified or zero, then a new unique identifier is allocated. Otherwise the specified number is used. See sign-identifier for more information. lnum Line number in the buffer where the sign is to be placed. For the accepted values, see line(). name Name of the sign to place. See sign_define() for more information. priority Priority of the sign. When multiple signs are placed on a line, the sign with the highest priority is used. If not specified, the default value of 10 is used. See sign-priority for more information.

If {id} refers to an existing sign, then the existing sign is modified to use the specified {name} and/or {priority}.

Returns a List of sign identifiers. If failed to place a sign, the corresponding list item is set to -1.

Examples:

" Place sign s1 with id 5 at line 20 and id 10 at line
" 30 in buffer a.c
let [n1, n2] = sign_placelist([
        \ {'id' : 5,
        \  'name' : 's1',
        \  'buffer' : 'a.c',
        \  'lnum' : 20},
        \ {'id' : 10,
        \  'name' : 's1',
        \  'buffer' : 'a.c',
        \  'lnum' : 30}
        \ ])

" Place sign s1 in buffer a.c at line 40 and 50
" with auto-generated identifiers
let [n1, n2] = sign_placelist([
        \ {'name' : 's1',
        \  'buffer' : 'a.c',
        \  'lnum' : 40},
        \ {'name' : 's1',
        \  'buffer' : 'a.c',
        \  'lnum' : 50}
        \ ])

Can also be used as a method:

GetSignlist()->sign_placelist()

Parameters

denops: Denops
list: unknown

Returns

Promise<unknown[]>