add occurrences_highlight.lua - #46
Open
KELs7 wants to merge 1 commit into
Open
Conversation
Member
|
Could you modify the settings to use the merge function and add a config spec? Something as seen on the minimap plugin: config.plugins.minimap = common.merge({
enabled = true,
width = 100,
status = "expanded",
instant_scroll = false,
syntax_highlight = true,
scale = 1,
-- number of spaces needed to split a token
spaces_to_split = 2,
-- hide on small docs (can be true, false or min number of lines)
avoid_small_docs = false,
-- how many spaces one tab is equivalent to
tab_width = 4,
draw_background = true,
-- you can override these colors
selection_color = nil,
caret_color = nil,
-- If other plugins provide per-line highlights,
-- this controls the placement. (e.g. gitdiff_highlight)
highlight_align = 'left',
highlight_width = 3,
gutter_width = 5,
-- The config specification used by the settings gui
config_spec = {
name = "Mini Map",
{
label = "Enabled",
description = "Activate the minimap by default.",
path = "enabled",
type = "toggle",
default = true
},
{
label = "Width",
description = "Width of the minimap in pixels.",
path = "width",
type = "number",
default = 100,
min = 50,
max = 1000
},
{
label = "Status",
description = "Default state for the minimap.",
path = "status",
type = "selection",
default = "expanded",
values = {
{"Auto", "auto"},
{"Expanded", "expanded"}
}
},
{
label = "Instant Scroll",
description = "When enabled disables the scrolling animation.",
path = "instant_scroll",
type = "toggle",
default = false
},
{
label = "Syntax Highlighting",
description = "Disable to improve performance.",
path = "syntax_highlight",
type = "toggle",
default = true
},
{
label = "Scale",
description = "Size of the minimap using a scaling factor.",
path = "scale",
type = "number",
default = 1,
min = 0.5,
max = 10,
step = 0.1
},
{
label = "Spaces to split",
description = "Number of spaces needed to split a token.",
path = "spaces_to_split",
type = "number",
default = 2,
min = 1
},
{
label = "Hide for small Docs",
description = "Hide the minimap when a Doc is small enough.",
path = "avoid_small_docs",
type = "toggle",
default = false
},
{
label = "Small Docs definition",
description = "Size of a Doc to be considered small. Use 0 to automatically decide.",
path = "avoid_small_docs_len",
type = "number",
default = 0,
min = 0,
on_apply = function(value)
if value == 0 then
config.plugins.minimap.avoid_small_docs = true
else
config.plugins.minimap.avoid_small_docs = value
end
end
},
{
label = "Tabs Width",
description = "The amount of spaces that represent a tab.",
path = "tab_width",
type = "number",
default = 4,
min = 1,
max = 8
},
{
label = "Draw Background",
description = "When disabled makes the minimap transparent.",
path = "draw_background",
type = "toggle",
default = true
},
{
label = "Selection Color",
description = "Background color of selected text.",
path = "selection_color",
type = "color",
default = string.format("#%02X%02X%02X%02X",
style.dim[1], style.dim[2], style.dim[3], style.dim[4]
)
},
{
label = "Caret Color",
description = "Background color of active line.",
path = "caret_color",
type = "color",
default = string.format("#%02X%02X%02X%02X",
style.caret[1], style.caret[2], style.caret[3], style.caret[4]
)
},
{
label = "Highlight Alignment",
path = "highlight_align",
type = "selection",
default = "left",
values = {
{"Left", "left"},
{"Right", "right"}
}
},
{
label = "Highlight Width",
path = "highlight_width",
type = "number",
default = 3,
min = 0,
max = 50
},
{
label = "Gutter Width",
description = "Left padding of the minimap.",
path = "gutter_width",
type = "number",
default = 5,
min = 0,
max = 50
},
}
}, config.plugins.minimap) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Occurrences Highlight for Pragtical
Occurrences Highlight brings VS Code's intelligent symbol and text occurrence highlighting to the Pragtical editor.
It automatically detects the symbol under your cursor—or any text you select—and instantly highlights all matching occurrences throughout your document in real-time. It also draws visual indicator tick marks directly onto the scrollbar track, making it effortless to navigate large files and jump directly to matching references.