Skip to content

Commit 90d036d

Browse files
committed
[css-hint addon] Integrate
1 parent b8e09e9 commit 90d036d

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

addon/hint/css-hint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
function getHints(cm) {
55
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
66
var inner = CodeMirror.innerMode(cm.getMode(), token.state);
7-
if (inner.mode.name != "css-base") return;
7+
if (inner.mode.name != "css") return;
88

99
// If it's not a 'word-style' token, ignore the token.
1010
if (!/^[\w$_-]*$/.test(token.string)) {

doc/compress.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ <h2>Script compression helper</h2>
157157
<option value="http://codemirror.net/addon/fold/comment-fold.js">comment-fold.js</option>
158158
<option value="http://codemirror.net/addon/comment/continuecomment.js">continuecomment.js</option>
159159
<option value="http://codemirror.net/addon/edit/continuelist.js">continuelist.js</option>
160+
<option value="http://codemirror.net/addon/hint/css-hint.js">css-hint.js</option>
160161
<option value="http://codemirror.net/addon/dialog/dialog.js">dialog.js</option>
161162
<option value="http://codemirror.net/addon/fold/foldcode.js">foldcode.js</option>
162163
<option value="http://codemirror.net/addon/display/fullscreen.js">fullscreen.js</option>

doc/manual.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,6 +2049,10 @@ <h2>Addons</h2>
20492049
schema data. See
20502050
the <a href="../demo/html5complete.html">demo</a>.</dd>
20512051

2052+
<dt id="addon_css-hint"><a href="../addon/hint/css-hint.js"><code>hint/css-hint.js</code></a></dt>
2053+
<dd>A minimal hinting function for CSS code.
2054+
Defines <code>CodeMirror.hint.css</code>.</dd>
2055+
20522056
<dt id="addon_python-hint"><a href="../addon/hint/python-hint.js"><code>hint/python-hint.js</code></a></dt>
20532057
<dd>A very simple hinting function for Python code.
20542058
Defines <code>CodeMirror.hint.python</code>.</dd>

mode/css/css.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
CodeMirror.defineMode("css", function(config) {
2-
return CodeMirror.getMode(config, "text/css");
3-
});
4-
5-
CodeMirror.defineMode("css-base", function(config, parserConfig) {
1+
CodeMirror.defineMode("css", function(config, parserConfig) {
62
"use strict";
73

4+
if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
5+
86
var indentUnit = config.indentUnit,
97
hooks = parserConfig.hooks || {},
108
atMediaTypes = parserConfig.atMediaTypes || {},
@@ -580,7 +578,7 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {
580578
return false;
581579
}
582580
},
583-
name: "css-base"
581+
name: "css"
584582
});
585583

586584
CodeMirror.defineMIME("text/x-scss", {
@@ -624,6 +622,6 @@ CodeMirror.defineMode("css-base", function(config, parserConfig) {
624622
}
625623
}
626624
},
627-
name: "css-base"
625+
name: "css"
628626
});
629627
})();

0 commit comments

Comments
 (0)