Skip to content

Commit bde9bfa

Browse files
authored
Highlight NULL instead of null in C/C++
CodeMirror C and C++ currently highlight the string "null", which isn't defined in C/C++. Those languages do macro "NULL", though.
1 parent 2ffbf48 commit bde9bfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mode/clike/clike.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
374374
blockKeywords: words("case do else for if switch while struct"),
375375
defKeywords: words("struct"),
376376
typeFirstDefinitions: true,
377-
atoms: words("null true false"),
377+
atoms: words("NULL true false"),
378378
hooks: {"#": cppHook, "*": pointerHook},
379379
modeProps: {fold: ["brace", "include"]}
380380
});
@@ -390,7 +390,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
390390
blockKeywords: words("catch class do else finally for if struct switch try while"),
391391
defKeywords: words("class namespace struct enum union"),
392392
typeFirstDefinitions: true,
393-
atoms: words("true false null"),
393+
atoms: words("true false NULL"),
394394
dontIndentStatements: /^template$/,
395395
isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
396396
hooks: {

0 commit comments

Comments
 (0)