aboutsummaryrefslogtreecommitdiff
path: root/plugins/force_syntax.lua
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-07-15 06:34:52 +0200
committerGitHub <noreply@github.com>2022-07-15 00:34:52 -0400
commitdfd0a5020fbf5904ca674256ff42510be5e11a48 (patch)
treeb02f25411f3e40a819577ebf2d607fe77a214f65 /plugins/force_syntax.lua
parenta1c7102578f166df804bf5dbdbe6aac6810dff2d (diff)
downloadlite-xl-plugins-dfd0a5020fbf5904ca674256ff42510be5e11a48.tar.gz
lite-xl-plugins-dfd0a5020fbf5904ca674256ff42510be5e11a48.zip
Use new `StatusView:add_item` syntax (#117)
Diffstat (limited to 'plugins/force_syntax.lua')
-rw-r--r--plugins/force_syntax.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/force_syntax.lua b/plugins/force_syntax.lua
index 5c1d2eb..ae5a138 100644
--- a/plugins/force_syntax.lua
+++ b/plugins/force_syntax.lua
@@ -39,23 +39,24 @@ local function get_syntax_name(s)
return name or "Undefined"
end
-core.status_view:add_item(
- function()
+core.status_view:add_item({
+ predicate = function()
return core.active_view and getmetatable(core.active_view) == DocView
end,
- "doc:syntax",
- StatusView.Item.RIGHT,
- function()
+ name = "doc:syntax",
+ alignment = StatusView.Item.RIGHT,
+ get_item = function()
local syntax_name = get_syntax_name(doc().syntax)
return {
style.text,
syntax_name
}
end,
- "force-syntax:select-file-syntax",
- -1,
- "file syntax"
-).separator = core.status_view.separator2
+ command = "force-syntax:select-file-syntax",
+ position = -1,
+ tooltip = "file syntax",
+ separator = core.status_view.separator2
+})
local function get_syntax_list()
local pt_name = plain_text_syntax.name