Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

nx.decor

nx.decor.provider(spec)

nx.decor.provider { name, bufs?, on_range }: register a viewport decoration provider. on_range(ctx, publish) is called off the frame, once per visible-range change of a matching window, with a snapshot ctx = { win, buf, top, bot, lines, filetype, buftype, gen } (top/bot are 0-based inclusive buffer rows; lines is exactly that slice; gen is the viewport generation a publish carries back). bufs scopes the provider: bufs.filetype = { "lua", "rust" } runs it only in those filetypes, bufs.buftype = { "quickfix" } only in those buffer kinds, bufs.buf = id only in a specific buffer (constraints AND together); omitted ⇒ every buffer (the engine skips non-matching windows). The provider calls publish(marks) with a list of marks shaped like an extmark — { row, col, end_row?, end_col?, hl?, priority? } (row/col may be positional { row, col, ... } or named). v1 renders hl; other fields fold into the extmark layer where they are accepted-but-unrendered until that layer grows them.

Defined in decor.lua.