Editor: add "!important" word to autocomplete in css properties
This commit is contained in:
parent
ed9ce87d99
commit
31a9be7c2a
17
edit.js
17
edit.js
|
@ -94,7 +94,7 @@ function initCodeMirror() {
|
|||
lint: CodeMirror.lint.css,
|
||||
keyMap: "sublime",
|
||||
extraKeys: {"Ctrl-Space": "autocomplete"}
|
||||
};
|
||||
}
|
||||
mergeOptions(stylishOptions, CM.defaults);
|
||||
mergeOptions(userOptions, CM.defaults);
|
||||
|
||||
|
@ -108,7 +108,20 @@ function initCodeMirror() {
|
|||
cc.jumpToLine = jumpToLine;
|
||||
cc.nextBuffer = nextBuffer;
|
||||
cc.prevBuffer = prevBuffer;
|
||||
// cc.save = save;
|
||||
|
||||
var cssHintHandler = CM.hint.css;
|
||||
CM.hint.css = function(cm) {
|
||||
var cursor = cm.getCursor();
|
||||
var token = cm.getTokenAt(cursor);
|
||||
if (token.state.state === "prop" && "!important".indexOf(token.string) === 0) {
|
||||
return {
|
||||
from: CM.Pos(cursor.line, token.start),
|
||||
to: CM.Pos(cursor.line, token.end),
|
||||
list: ["!important"]
|
||||
}
|
||||
}
|
||||
return cssHintHandler(cm);
|
||||
}
|
||||
|
||||
// user option values
|
||||
CM.getOption = function (o) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user