aboutsummaryrefslogtreecommitdiff
path: root/plugins/linenumbers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/linenumbers.lua')
-rw-r--r--plugins/linenumbers.lua26
1 files changed, 20 insertions, 6 deletions
diff --git a/plugins/linenumbers.lua b/plugins/linenumbers.lua
index 76c691d..5cf198a 100644
--- a/plugins/linenumbers.lua
+++ b/plugins/linenumbers.lua
@@ -7,7 +7,25 @@ local command = require "core.command"
config.plugins.linenumbers = common.merge({
show = true,
- relative = false
+ relative = false,
+ -- The config specification used by the settings gui
+ config_spec = {
+ name = "Line Numbers",
+ {
+ label = "Show Numbers",
+ description = "Display or hide the line numbers.",
+ path = "show",
+ type = "toggle",
+ default = true
+ },
+ {
+ label = "Relative Line Numbers",
+ description = "Display relative line numbers starting from active line.",
+ path = "relative",
+ type = "toggle",
+ default = false
+ }
+ }
}, config.plugins.linenumbers)
local draw_line_gutter = DocView.draw_line_gutter
@@ -15,11 +33,7 @@ local get_width = DocView.get_gutter_width
function DocView:draw_line_gutter(line, x, y, width)
local lh = self:get_line_height()
- if
- not config.plugins.linenumbers.show
- and
- not config.plugins.linenumbers.relative
- then
+ if not config.plugins.linenumbers.show then
return lh
end