Skip to main content
Module

x/denops_std/function/vim/mod.ts>prop_list

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

Returns a List with all the text properties in line {lnum}.

The following optional items are supported in {props}: bufnr use this buffer instead of the current buffer end_lnum return text properties in all the lines between {lnum} and {end_lnum} (inclusive). A negative value is used as an offset from the last buffer line; -1 refers to the last buffer line. types List of property type names. Return only text properties that match one of the type names. ids List of property identifiers. Return only text properties with one of these identifiers.

The properties are ordered by starting column and priority. Each property is a Dict with these entries: lnum starting line number. Present only when returning text properties between {lnum} and {end_lnum}. col starting column length length in bytes, one more if line break is included id property ID text text to be displayed before {col}. Only present for virtual-text properties. text_align alignment property of virtual-text. text_padding_left left padding used for virtual text. text_wrap specifies whether virtual-text is wrapped. type name of the property type, omitted if the type was deleted type_bufnr buffer number for which this type was defined; 0 if the type is global start when TRUE property starts in this line end when TRUE property ends in this line

When "start" is zero the property started in a previous line, the current one is a continuation. When "end" is zero the property continues in the next line. The line break after this line is included.

Returns an empty list on error.

Examples: " get text properties placed in line 5 echo prop_list(5) " get text properties placed in line 20 in buffer 4 echo prop_list(20, {'bufnr': 4}) " get all the text properties between line 1 and 20 echo prop_list(1, {'end_lnum': 20}) " get all the text properties of type 'myprop' echo prop_list(1, {'types': ['myprop'], \ 'end_lnum': -1}) " get all the text properties of type 'prop1' or 'prop2' echo prop_list(1, {'types': ['prop1', 'prop2'], \ 'end_lnum': -1}) " get all the text properties with ID 8 echo prop_list(1, {'ids': [8], 'end_lnum': line('$')}) " get all the text properties with ID 10 and 20 echo prop_list(1, {'ids': [10, 20], 'end_lnum': -1}) " get text properties with type 'myprop' and ID 100 " in buffer 4. echo prop_list(1, {'bufnr': 4, 'types': ['myprop'], \ 'ids': [100], 'end_lnum': -1})

Can also be used as a method:

GetLnum()->prop_list()

Parameters

denops: Denops
lnum: unknown
optional
props: unknown

Returns

Promise<unknown[]>