diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-07-15 06:34:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 00:34:52 -0400 |
commit | dfd0a5020fbf5904ca674256ff42510be5e11a48 (patch) | |
tree | b02f25411f3e40a819577ebf2d607fe77a214f65 /plugins/typingspeed.lua | |
parent | a1c7102578f166df804bf5dbdbe6aac6810dff2d (diff) | |
download | lite-xl-plugins-dfd0a5020fbf5904ca674256ff42510be5e11a48.tar.gz lite-xl-plugins-dfd0a5020fbf5904ca674256ff42510be5e11a48.zip |
Use new `StatusView:add_item` syntax (#117)
Diffstat (limited to 'plugins/typingspeed.lua')
-rw-r--r-- | plugins/typingspeed.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/typingspeed.lua b/plugins/typingspeed.lua index 14bd91c..0e28ec9 100644 --- a/plugins/typingspeed.lua +++ b/plugins/typingspeed.lua @@ -82,19 +82,19 @@ function DocView:on_text_input(text, idx) on_text_input(self, text, idx) 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, - "typing-speed:stats", - core.status_view.Item.RIGHT, - function() + name = "typing-speed:stats", + alignment = core.status_view.Item.RIGHT, + get_item = function() return { style.text, string.format("%.0f CPM / %.0f WPM", cpm, wpm) } end, - nil, - 1, - "characters / words per minute" -).separator = core.status_view.separator2 + position = 1, + tooltip = "characters / words per minute", + separator = core.status_view.separator2 +}) |