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

Go Comment can be colorful #505

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Go Comment can be colorful #505

wants to merge 24 commits into from

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

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.

2 participants