You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 6, 2026. It is now read-only.
@brammool: This was likely always valid C/C++, you can check yourself
with `gcc` or `g++`. The requirement seems to be the line needs to be
devoid of statements before the preprocessor directive.
```C++
(void)0; #ifdef POSIX
#endif
```
```
error: stray # in program
(void)0; #ifdef POSIX
^
```
and an ensuing error about the mismatched `#endif`.
Vim doesn't see the #ifdef as preproc, thus I would think that is OK.
Highlighting it as an error doesn't seem useful. It would cause a lot
of flickering while typing.
--
ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
BROTHER MAYNARD
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
@brammool: That was a counterexample, the bug was about this case:
```C++
/**/ #ifdef POSIX
#endif
```
Which isn't highlighted properly by Vim (or GitHub), despite being
valid C/C++. There may be any amount of whitespace before a
preprocessor directive on a line and comments seem to count as part of
this whitespace.
I'm quite sure older C standards do not allow this. I would never write
it like this anyway.
Currently we recognize the # at the start of the line. Allowing a
comment before it isn't that easy. Properly detecting /* */ comments
is difficult anyway.
I think we can just leave this out.
--
(letter from Mark to Mike, about the film's probable certificate)
For an 'A' we would have to: Lose as many shits as possible; Take Jesus
Christ out, if possible; Loose "I fart in your general direction"; Lose
"the oral sex"; Lose "oh, fuck off"; Lose "We make castanets out of your
testicles"
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Activity
mattn commentedon Aug 29, 2016
I'm not sure, but removing
^fixes this syntax.rhysd commentedon Sep 1, 2016
I think
\s*at the head of pattern should be removed as well.mattn commentedon Sep 1, 2016
right
brammool commentedon Nov 17, 2016
Since when is putting a comment before #if valid C?
mattn commentedon Nov 18, 2016
@brammool This should fix it.
8976dec
mattn commentedon Nov 18, 2016
@brammool or, do you ask me why need this change?
mattn commentedon Nov 18, 2016
@brammool Ah, I understanded it just now. vim/vim#1257 (comment)
mattn commentedon Apr 26, 2017
I rebased this repository. And reverted 8976dec
So this issue still are remaining.
brammool commentedon May 15, 2017
brammool commentedon May 16, 2017
mattn commentedon May 17, 2017
To fix this, it need the regexp pattern enough to be confusable. And it will take heavy load.