-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very interesting feature 😄
lua/go/comment.lua
Outdated
pattern = { '*.go' }, | ||
callback = function() | ||
if _GO_NVIM_CFG.comment.enable_highlight then | ||
require('go.comment').highlight() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, added deboucer
I have terrible taste in highlights, and the predefined definitely not coming from a pro!
reference: golang/go#64648