Skip to content

Go Comment can be colorful#505

Open
ray-x wants to merge 24 commits intomasterfrom
hightlight_comments
Open

Go Comment can be colorful#505
ray-x wants to merge 24 commits intomasterfrom
hightlight_comments

Conversation

@ray-x
Copy link
Owner

@ray-x ray-x commented Sep 19, 2024

I have terrible taste in highlights, and the predefined definitely not coming from a pro!

image

reference: golang/go#64648

Copy link
Contributor

@qvalentin qvalentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting feature 😄

pattern = { '*.go' },
callback = function()
if _GO_NVIM_CFG.comment.enable_highlight then
require('go.comment').highlight()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to debounce the function if is run on TextChanged and InsertLeave.

-- Debounced function call
local function debounced_function()
  if debounce_timer then
    debounce_timer:stop()
  end
  debounce_timer = vim.defer_fn(function()
    original_function()
  end, 200) -- 200ms debounce time
end

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, added deboucer

@edte
Copy link

edte commented Jan 10, 2025

Hello, can this request be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants