-
Notifications
You must be signed in to change notification settings - Fork 706
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
There should be some way to highlight the inside of a region #2401
Comments
Is this related to adding rust highlighting in rust doc comments? Also, is this markdown related?
Currently, the quote part is not highlighted. I believe the same goes for rust. //! Hello world
//! ```
//! println!("hello world");
//! ``` |
Rust doc blocks already work (I forgot when but quite some time ago), I ported a similar version from rust.vim. It even checks checks for the correct term, like |
The Markdown highlighter contains support for highlighting different languages in fenced code blocks, like this:
The actual Kakoune script it generates looks something like this (at least, after PR #2400 lands):
As I understand it, this means:
rust
, and ends with a line with the same indent containing a triple-quote.There's just one problem: the inner region doesn't necessarily end before the closing marker, it ends before the first triple-backtick. So if I have a code-block like this:
...the Rust highlighting ends in the middle of the second line, instead of continuing until the end. The obvious solution is to change the region-end regex from
(?=```)
to(?=```\z)
since we want to end the region when we hit the closing marker, not any old triple-backtick. Unfortunately, that solution produces an error:I know that Kakoune's non-backtracking regex-engine implies certain limitations about lookahead and lookbehind, but I vaguely recall the current implementation is overly restrictive. If this particular restriction is not entirely necessary, it would be great if it could be lifted.
Other alternatives that I can think of:
\K
, that resets the end position of capture group 0 to the current position.The text was updated successfully, but these errors were encountered: