From 3a93220f7589ad4a198a0bc654682f696673a368 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Thu, 27 Jul 2023 16:53:49 -0600 Subject: Lua API: access and set all available options The first point of this commit is to allow all options to be read from lua. This has a number of uses for plugin writers. They are grouped into a couple of tables depending on what they control: `vis.options`: table with global configuration `win.options`: table with window specific configuration The second point is to allow you to set all these options as if they were simply lua variables. Technically this is already possible by using `vis:command("set ...")` but personally I think this interface is cleaner. Note that this already possible for some things like the current mode (eg. vis.mode = vis.modes.VISUAL). Examples: `vis.options.ai = true` `win.options.brk = " !?."` `win.options = { showeof = true, showtabs = true } There are a number of related issues and pull requests: closes #803: Lua API: let plugins read the values of options closes #812: Window layout property supersedes/closes #717: Add ability to access tabwidth from Lua supersedes/closes #1066: expose UI layout and allow it to be set from lua API --- ui.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ui.h') diff --git a/ui.h b/ui.h index 42cdbda..ce98af1 100644 --- a/ui.h +++ b/ui.h @@ -117,5 +117,6 @@ struct UiWin { }; bool is_default_color(CellColor c); +enum UiLayout ui_layout_get(Ui *ui); #endif -- cgit v1.2.3