(C) \ not respected
See original GitHub issueDescribe the issue
Which language seems to have the issue?
C
Are you using highlight
or highlightAuto
?
highlight
Sample Code to Reproduce
https://jsfiddle.net/gm16s8nf/
// this is a comment, but since I added a slash, \
this is part of it too
Expected behavior
In C, a ‘\’ character extends the current lined (effectively negating the following \n
)
Since the second line is also part of the comment, it should be highlighted as such.
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
c++ - alignas keyword not respected - Stack Overflow
operator new is borken, the compiler knows the alignment requirement but has no way to tell the operator about it. So this is...
Read more >shortmess+=c not respected by "Pattern not found" #11530
@brammool My use case is that I have a component in my statusline that shows up whenever search for something and shows me...
Read more >$C([0,1])$ is not complete with respect to $L^1$-norm.
I have a more general question about showing that a normed vector space is not complete with respect to a given norm. We...
Read more >Do Your Employees Feel Respected?
Earned respect recognizes individuals who display valued qualities or behaviors and acknowledges that each employee has specific strengths and talents.
Read more >49 CFR § 40.347 - What functions may C/TPAs perform with ...
49 CFR § 40.347 - What functions may C/TPAs perform with respect to ... (2) Employees not covered by DOT agency regulations may...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hmmm.
C_LINE_COMMENT_MODE
is used in 62 language definitions. As far as I know (might be wrong), no languages other than C and C++ actually support line continuations though. And while rare I don’t think it’s unthinkable that somebody is using\
at the end of their line, e.g. as an ornamental border. I think it would be best if we keptC_LINE_COMMENT_MODE
unchanged and used something different forc-like
. The name is a bit odd then, but not really; these are C-style line comments, after all.HAHAHAHA.
Wholly agree - lets fix the reported problem. 😃 The rest is outside scope. Do you have any thoughts on negative impact that might have on other languages using the C rule but NOT fully complying? I’m guessing it would be minimal (or zero impact) and therefore ok to add this to our
C_
modes (esp. since that is their name).