diff options
author | Gaspartcho <93390411+Gaspartcho@users.noreply.github.com> | 2024-03-14 12:17:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 12:17:48 +0100 |
commit | d167438794e1ff099ca2b4facc1364bbaaa1343a (patch) | |
tree | efcc09261e8c279c0c06f786295e50c774297052 | |
parent | 25769c073249eeead34c96e39daaf8e0aee3977f (diff) | |
download | lite-xl-plugins-d167438794e1ff099ca2b4facc1364bbaaa1343a.tar.gz lite-xl-plugins-d167438794e1ff099ca2b4facc1364bbaaa1343a.zip |
Update indentguide: Set the curent guide line highlight as optional (#383)
* Update indentguide.lua
* Update manifest.json
* Update manifest.json
-rw-r--r-- | manifest.json | 2 | ||||
-rw-r--r-- | plugins/indentguide.lua | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/manifest.json b/manifest.json index 16470a1..334a252 100644 --- a/manifest.json +++ b/manifest.json @@ -545,7 +545,7 @@ }, { "description": "Adds indent guides *([screenshot](https://user-images.githubusercontent.com/3920290/79640716-f9860000-818a-11ea-9c3b-26d10dd0e0c0.png))*", - "version": "0.1", + "version": "0.2", "path": "plugins/indentguide.lua", "id": "indentguide", "mod_version": "3" diff --git a/plugins/indentguide.lua b/plugins/indentguide.lua index 42eb3a6..0b40116 100644 --- a/plugins/indentguide.lua +++ b/plugins/indentguide.lua @@ -6,6 +6,7 @@ local DocView = require "core.docview" config.plugins.indentguide = common.merge({ enabled = true, + highlight = true, -- The config specification used by the settings gui config_spec = { name = "Indent Guide", @@ -15,6 +16,13 @@ config.plugins.indentguide = common.merge({ path = "enabled", type = "toggle", default = true + }, + { + label = "Highlight Line", + description = "Toggle the highlight of the curent indentation indicator lines.", + path = "highlight", + type = "toggle", + default = true } } }, config.plugins.indentguide) @@ -133,7 +141,9 @@ function DocView:draw_line_text(line, x, y) for i = 0, spaces - 1, indent_size do local color = style.guide or style.selection local active_lvl = self.indentguide_indent_active[line] or -1 - if i < active_lvl and i + indent_size >= active_lvl then + if i < active_lvl + and i + indent_size >= active_lvl + and config.plugins.indentguide.highlight then color = style.guide_highlight or style.accent end local sw = space_sz * i |