-
Notifications
You must be signed in to change notification settings - Fork 705
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 syntax highlighting in Markdown code block #1735
Comments
I tried to make a hacky-ish solution based on my very primitive understanding of how highlighters work by editing this line from:
to
or even
but no variation on these seem to work. |
@dgrisham I suspect
Will do the trick, you cannot use |
Fixes mawww#1735 We need \K to not interfer with languages own interpretation of ` like multiline strings in javascript We need \b in e.g. java\b otherwise it blocks javascript I couldn't get the bare ``` to not block the other highlighters when introducing \K any other way than negative lookahead of all possible highlighers
@mawww Nice, that (+ the other changes @danr made) work for me. Thanks! And yeah, it seems like it could be quite clean to be able to specify a region by either included or excluded boundaries -- especially since that might also take care of the comprehensive negative lookbehind that is needed at the moment, unless there's another way around that. |
Type: Bug
Severity: Low
Version: Not sure how to get the version via CLI, but whichever is in the AUR https://aur.archlinux.org/packages/kakoune-git. I just updated, but the issue was there prior to the update as well (and the last time I updated kakoune was at least a month ago).
Description
When writing a
go
code block in amarkdown
file, e.g.The entire code block, including the leading ```go and trailing ```, are treated as one big string literal (which start and end with backticks) which means everything is just a single color. My guess is that the issue is with the
markdown.kak
file rather thango.kak
, since the highlighting inside a code block shouldn't be affected by the characters defining the block itself.Edit Also note that the following modification, putting a ` after
go
fixes the highlighting inside the block (which isn't a solution, of course, but helps identify the issue):Edit 2 Lot of backticks here, editing the formatting for clarity. Also, I suppose it likely isn't treating it as 'one big string literal', rather the first two backticks make an empty string literal, then the next backtick starts another, which is then closed by the first backtick in the closing ```, and finally the last two backticks in the closing trio make another empty string literal.
The text was updated successfully, but these errors were encountered: