Skip to main content

plugins.settings

local settings = require "plugins.settings"

config

(field) config: table

core

(field) core: table

default_keybindings

(field) default_keybindings: table

plugin_sections

(field) plugin_sections: table

plugins

(field) plugins: table

sections

(field) sections: table

type

(field) type: table<string, integer>

Enumeration for the different types of settings.


ui

(field) ui: settings.ui

settings.option

Represents a setting to render on a settings pane.

default

(field) default: boolean|string|number|table<integer, integer>|table<integer, string>

Default value of the option


description

(field) description: string

Description of the option eg: "Modifies the document indentation"


exists

(field) exists: boolean

When FILE or DIRECTORY this flag tells the path should exist.


filters

(field) filters: table<integer, string>

Lua patterns used on FILE or DIRECTORY to filter browser results and also force the selection to match one of the filters.


font_error

(field) font_error: boolean

Flag set to true when loading user defined fonts fail


fonts_list

(field) fonts_list: table<string, renderer.font>

Optionally used for FONT to store the generated font group.


get_value

(field) get_value: fun(value: any):any|nil

Optional function that is used to manipulate the current value on retrieval.


icon

(field) icon: string

The icon set for a BUTTON


label

(field) label: string

Title displayed to the user eg: "My Option"


max

(field) max: number

Used for NUMBER to indiciate the maximum number allowed


min

(field) min: number

Used for NUMBER to indicate the minimum number allowed


on_apply

(field) on_apply: fun(value: any)|nil

Optional function executed when the option value is applied.


on_click

(field) on_click: string|fun(button: string, x: integer, y: integer)|nil

Command or function executed when a BUTTON is clicked


path

(field) path: string

Config path in the config table, eg: section.myoption, myoption, etc...


set_value

(field) set_value: fun(value: any):any|nil

Optional function that is used to manipulate the saved value on save.


step

(field) step: number

Used for NUMBER to indiciate the increment/decrement amount


type

(field) type: integer|`settings.type.BUTTON`|`settings.type.COLOR`|`settings.type.DIRECTORY`|`settings.type.FILE`...(+6)

Type of option that will be used to render an appropriate control


values

(field) values: table

Used in a SELECTION to provide the list of valid options


settings.ui

about

(field) about: widget

colors

(field) colors: widget

core

(field) core: widget

core_sections

(field) core_sections: widget.foldingbook

defer_draw

(field) defer_draw: boolean

draggable

(field) draggable: boolean

keybinds

(field) keybinds: widget

name

(field) name: string

notebook

(field) notebook: widget.notebook

plugin_sections

(field) plugin_sections: widget.foldingbook

plugins

(field) plugins: widget

scrollable

(field) scrollable: boolean

disable_plugin

(method) settings.ui:disable_plugin(plugin: string)

Unload a plugin settings from plugins section.


enable_plugin

(method) settings.ui:enable_plugin(plugin: string)

Load plugin and append its settings to the plugins section.


load_color_settings

(method) settings.ui:load_color_settings()

Generate the list of all available colors with preview


load_core_settings

(method) settings.ui:load_core_settings()

Generate all the widgets for core settings.


load_keymap_settings

(method) settings.ui:load_keymap_settings()

Generate the list of all available commands and allow editing their keymaps.


load_plugin_settings

(method) settings.ui:load_plugin_settings()

Generate all the widgets for plugin settings.


new

(method) settings.ui:new()

Constructor


setup_about

(method) settings.ui:setup_about()

update

(method) settings.ui:update()

Reposition and resize core and plugin widgets.


add

function plugins.settings.add(section: string, options: settings.option[], plugin_name?: string, overwrite?: boolean)

Add a new settings section to the settings UI

@param plugin_name — Optional name of plugin

@param overwrite — Overwrite previous section options