Adding change to init update in PM
This commit is contained in:
14
gulliver/js/codemirror/addon/lint/json-lint.js
vendored
Normal file
14
gulliver/js/codemirror/addon/lint/json-lint.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Depends on jsonlint.js from https://github.com/zaach/jsonlint
|
||||
|
||||
CodeMirror.jsonValidator = function(text) {
|
||||
var found = [];
|
||||
jsonlint.parseError = function(str, hash) {
|
||||
var loc = hash.loc;
|
||||
found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
|
||||
to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
|
||||
message: str});
|
||||
};
|
||||
try { jsonlint.parse(text); }
|
||||
catch(e) {}
|
||||
return found;
|
||||
};
|
||||
Reference in New Issue
Block a user