Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom highlight of line number for folded text #168

Open
ReubenM opened this issue Oct 6, 2023 · 0 comments
Open

Allow custom highlight of line number for folded text #168

ReubenM opened this issue Oct 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@ReubenM
Copy link

ReubenM commented Oct 6, 2023

Feature description

Title should be self explanatory.

Describe the solution you'd like

Something more elaborate might be more fitting, but for a quick hack:

diff --git a/lua/ufo/highlight.lua b/lua/ufo/highlight.lua
index 3f8dfc8..3f1baf4 100644
--- a/lua/ufo/highlight.lua
+++ b/lua/ufo/highlight.lua
@@ -60,6 +60,7 @@ local function resetHighlightGroup()
         hi default link UfoPreviewCursorLine Visual
         hi default link UfoFoldedEllipsis Comment
         hi default link UfoCursorFoldedLine CursorLine
+        hi default link UfoFoldedLineNr LineNr
     ]])
 end
 
diff --git a/lua/ufo/model/foldedline.lua b/lua/ufo/model/foldedline.lua
index 1cfdae1..bca690d 100644
--- a/lua/ufo/model/foldedline.lua
+++ b/lua/ufo/model/foldedline.lua
@@ -50,7 +50,8 @@ function FoldedLine:updateVirtText(lnum, endLnum, virtText)
         virt_text = virtText,
         virt_text_win_col = 0,
         priority = 10,
-        hl_mode = 'combine'
+        hl_mode = 'combine',
+        number_hl_group = 'UfoFoldedLineNr'
     })
     self.virtText = virtText
 end

Additional context

No response

@ReubenM ReubenM added the enhancement New feature or request label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant