aboutsummaryrefslogtreecommitdiff
path: root/plugins/scalestatus.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/scalestatus.lua')
-rw-r--r--plugins/scalestatus.lua14
1 files changed, 3 insertions, 11 deletions
diff --git a/plugins/scalestatus.lua b/plugins/scalestatus.lua
index 2981523..8f3ef68 100644
--- a/plugins/scalestatus.lua
+++ b/plugins/scalestatus.lua
@@ -1,24 +1,16 @@
--- mod-version:1 -- lite-xl 1.16
+-- mod-version:2 -- lite-xl 2.0
--[[
scalestatus.lua
displays current scale (zoom) in status view
version: 20200628_155804
originally by SwissalpS
-
- Depends on plugin scale.lua version >= 20200628_154010
--]]
local scale = require "plugins.scale"
--- make sure plugin is installed and has get_scale field
-if not scale.get_scale then
- local core = require "core"
- core.error("Plugin 'scale' needs to be updated, scalestatus inactive.")
- return false
-end
local config = require "core.config"
local StatusView = require "core.statusview"
-config.scalestatus_format = '%.0f%%'
+config.plugins.scalestatus = { format = '%.0f%%' }
local get_items = StatusView.get_items
function StatusView:get_items()
@@ -27,7 +19,7 @@ function StatusView:get_items()
local t = {
self.separator,
- string.format(config.scalestatus_format, scale.get_scale() * 100),
+ string.format(config.plugins.scalestatus.format, scale.get() * 100),
}
for _, item in ipairs(t) do