11 changes: 11 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ anaran
AndersMad
Anders Nawroth
Anderson Mesquita
Andrea G
Andreas Reischuck
Andre von Houck
Andrey Fedorov
Andrey Klyuchnikov
Andrey Lushnikov
Andy Joslin
Andy Kimball
Expand Down Expand Up @@ -86,6 +88,7 @@ ComFreek
Curtis Gagliardi
dagsta
daines
Dale Jung
Dan Heberden
Daniel, Dao Quang Minh
Daniele Di Sarli
Expand Down Expand Up @@ -144,6 +147,7 @@ Golevka
Gordon Smith
Grant Skinner
greengiant
Gregory Koberger
Guillaume Massé
Guillaume Massé
Gustavo Rodrigues
Expand Down Expand Up @@ -176,6 +180,7 @@ jankeromnes
Jan Keromnes
Jan Odvarko
Jan T. Sott
Jared Forsyth
Jason
Jason Grout
Jason Johnston
Expand All @@ -186,6 +191,7 @@ Jean Boussier
jeffkenton
Jeff Pickhardt
jem (graphite)
Jeremy Parmenter
Jochen Berger
Johan Ask
John Connor
Expand Down Expand Up @@ -229,6 +235,7 @@ LM
lochel
Lorenzo Stoakes
Luciano Longo
Luke Stagner
lynschinzer
Maksim Lin
Maksym Taran
Expand Down Expand Up @@ -288,8 +295,10 @@ nextrevision
nguillaumin
Ng Zhi An
Nicholas Bollweg
Nicholas Bollweg (Nick)
Nick Small
Niels van Groningen
nightwing
Nikita Beloglazov
Nikita Vasilyev
Nikolay Kostov
Expand All @@ -316,6 +325,7 @@ prasanthj
Prasanth J
Radek Piórkowski
Rahul
Randy Burden
Randy Edmunds
Rasmus Erik Voel Jensen
Richard van der Meer
Expand All @@ -335,6 +345,7 @@ satchmorun
sathyamoorthi
SCLINIC\jdecker
Scott Aikin
Scott Goodhew
Sebastian Zaha
shaund
shaun gilchrist
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Getting help

Community discussion, questions, and informal bug reporting is done on the
[CodeMirror Google group](http://groups.google.com/group/codemirror).
[discuss.CodeMirror forum](http://discuss.codemirror.net).

## Submitting bug reports

Expand All @@ -17,7 +17,7 @@ reporting a bug, read these pointers.

**Note:** The issue tracker is for *bugs*, not requests for help. Questions
should be asked on the
[CodeMirror Google group](http://groups.google.com/group/codemirror) instead.
[discuss.CodeMirror forum](http://discuss.codemirror.net) instead.

### Reporting bugs effectively

Expand Down
2 changes: 1 addition & 1 deletion addon/edit/closebrackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
};
var closingBrackets = "";
for (var i = 0; i < pairs.length; i += 2) (function(left, right) {
if (left != right) closingBrackets += right;
closingBrackets += right;
map["'" + left + "'"] = function(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections(), type, next;
Expand Down
18 changes: 9 additions & 9 deletions addon/hint/javascript-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");

function getCompletions(token, context, keywords, options) {
var found = [], start = token.string;
var found = [], start = token.string, global = options && options.globalScope || window;
function maybeAdd(str) {
if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
}
Expand All @@ -112,28 +112,28 @@
if (options && options.additionalContext)
base = options.additionalContext[obj.string];
if (!options || options.useGlobalScope !== false)
base = base || window[obj.string];
base = base || global[obj.string];
} else if (obj.type == "string") {
base = "";
} else if (obj.type == "atom") {
base = 1;
} else if (obj.type == "function") {
if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
(typeof window.jQuery == 'function'))
base = window.jQuery();
else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function'))
base = window._();
if (global.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
(typeof global.jQuery == 'function'))
base = global.jQuery();
else if (global._ != null && (obj.string == '_') && (typeof global._ == 'function'))
base = global._();
}
while (base != null && context.length)
base = base[context.pop().string];
if (base != null) gatherCompletions(base);
} else {
// If not, just look in the window object and any local scope
// If not, just look in the global object and any local scope
// (reading into JS mode internals to get at the local and global variables)
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
if (!options || options.useGlobalScope !== false)
gatherCompletions(window);
gatherCompletions(global);
forEach(keywords, maybeAdd);
}
return found;
Expand Down
10 changes: 9 additions & 1 deletion addon/hint/xml-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@
var quote = (options && options.quoteChar) || '"';
if (!tags) return;
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
if (/^<\/?$/.test(token.string) && token.end == cur.ch) {
var nextToken = cm.getTokenAt(Pos(cur.line, cur.ch + 1));
if (nextToken.start == cur.ch && /\btag\b/.test(nextToken.type))
token = nextToken;
}
var inner = CodeMirror.innerMode(cm.getMode(), token.state);
if (inner.mode.name != "xml") return;
var result = [], replaceToken = false, prefix;
var tag = /\btag\b/.test(token.type), tagName = tag && /^\w/.test(token.string), tagStart;
var tag = /\btag\b/.test(token.type) && !/>$/.test(token.string);
var tagName = tag && /^\w/.test(token.string), tagStart;

if (tagName) {
var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);
var tagType = /<\/$/.test(before) ? "close" : /<$/.test(before) ? "open" : null;
Expand All @@ -31,6 +38,7 @@
} else if (tag && token.string == "</") {
tagType = "close";
}

if (!tag && !inner.state.tagName || tagType) {
if (tagName)
prefix = token.string;
Expand Down
35 changes: 19 additions & 16 deletions addon/mode/loadmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
mod(require("../../lib/codemirror"), "cjs");
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); });
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
mod(CodeMirror, "plain");
})(function(CodeMirror, env) {
if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js";

var loading = {};
Expand All @@ -35,21 +35,24 @@
if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);
if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);

var script = document.createElement("script");
script.src = CodeMirror.modeURL.replace(/%N/g, mode);
var others = document.getElementsByTagName("script")[0];
others.parentNode.insertBefore(script, others);
var list = loading[mode] = [cont];
var count = 0, poll = setInterval(function() {
if (++count > 100) return clearInterval(poll);
if (CodeMirror.modes.hasOwnProperty(mode)) {
clearInterval(poll);
loading[mode] = null;
var file = CodeMirror.modeURL.replace(/%N/g, mode);
if (env == "plain") {
var script = document.createElement("script");
script.src = file;
var others = document.getElementsByTagName("script")[0];
var list = loading[mode] = [cont];
CodeMirror.on(script, "load", function() {
ensureDeps(mode, function() {
for (var i = 0; i < list.length; ++i) list[i]();
});
}
}, 200);
});
others.parentNode.insertBefore(script, others);
} else if (env == "cjs") {
require(file);
cont();
} else if (env == "amd") {
requirejs([file], cont);
}
};

CodeMirror.autoLoadMode = function(instance, mode) {
Expand Down
6 changes: 3 additions & 3 deletions addon/mode/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
overlay: CodeMirror.startState(overlay),
basePos: 0, baseCur: null,
overlayPos: 0, overlayCur: null,
lineSeen: null
streamSeen: null
};
},
copyState: function(state) {
Expand All @@ -41,9 +41,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
},

token: function(stream, state) {
if (stream.sol() || stream.string != state.lineSeen ||
if (stream != state.streamSeen ||
Math.min(state.basePos, state.overlayPos) < stream.start) {
state.lineSeen = stream.string;
state.streamSeen = stream;
state.basePos = state.overlayPos = stream.start;
}

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codemirror",
"version":"4.7.0",
"version":"4.8.0",
"main": ["lib/codemirror.js", "lib/codemirror.css"],
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion demo/closebrackets.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script>
<script src="../addon/edit/closebrackets.js"></script>
<script src="../mode/xml/xml.js"></script>
<script src="../mode/javascript/javascript.js"></script>
<style type="text/css">
.CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
</style>
Expand Down
7 changes: 4 additions & 3 deletions demo/mustache.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ <h1>{{title}}</h1>
var ch;
if (stream.match("{{")) {
while ((ch = stream.next()) != null)
if (ch == "}" && stream.next() == "}") break;
stream.eat("}");
return "mustache";
if (ch == "}" && stream.next() == "}") {
stream.eat("}");
return "mustache";
}
}
while (stream.next() != null && !stream.match("{{", false)) {}
return null;
Expand Down
11 changes: 4 additions & 7 deletions demo/sublime.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ <h2>Sublime Text bindings demo</h2>

<script>
var value = "// The bindings defined specifically in the Sublime Text mode\nvar bindings = {\n";
var map = CodeMirror.keyMap.sublime, mapK = CodeMirror.keyMap["sublime-Ctrl-K"];
var map = CodeMirror.keyMap.sublime;
for (var key in map) {
if (key != "Ctrl-K" && key != "fallthrough" && (!/find/.test(map[key]) || /findUnder/.test(map[key])))
value += " \"" + key + "\": \"" + map[key] + "\",\n";
}
for (var key in mapK) {
if (key != "auto" && key != "nofallthrough")
value += " \"Ctrl-K " + key + "\": \"" + mapK[key] + "\",\n";
var val = map[key];
if (key != "fallthrough" && val != "..." && (!/find/.test(val) || /findUnder/.test(val)))
value += " \"" + key + "\": \"" + val + "\",\n";
}
value += "}\n\n// The implementation of joinLines\n";
value += CodeMirror.commands.joinLines.toString().replace(/^function\s*\(/, "function joinLines(").replace(/\n /g, "\n") + "\n";
Expand Down
2 changes: 1 addition & 1 deletion demo/vim.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2>Vim bindings demo</h2>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
mode: "text/x-csrc",
vimMode: true,
keyMap: "vim",
matchBrackets: true,
showCursorWhenSelecting: true
});
Expand Down
3 changes: 3 additions & 0 deletions doc/compress.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ <h2>Script compression helper</h2>
<input type="hidden" id="download" name="download" value="codemirror-compressed.js"/>
<p>Version: <select id="version" onchange="setVersion(this);" style="padding: 1px;">
<option value="http://codemirror.net/">HEAD</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.8.0;f=">4.8</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.7.0;f=">4.7</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.6.0;f=">4.6</option>
<option value="http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=4.5.0;f=">4.5</option>
Expand Down Expand Up @@ -106,6 +107,7 @@ <h2>Script compression helper</h2>
<option value="http://codemirror.net/mode/d/d.js">d.js</option>
<option value="http://codemirror.net/mode/diff/diff.js">diff.js</option>
<option value="http://codemirror.net/mode/django/django.js">django.js</option>
<option value="http://codemirror.net/mode/dockerfile/dockerfile.js">dockerfile.js</option>
<option value="http://codemirror.net/mode/dtd/dtd.js">dtd.js</option>
<option value="http://codemirror.net/mode/dylan/dylan.js">dylan.js</option>
<option value="http://codemirror.net/mode/ecl/ecl.js">ecl.js</option>
Expand All @@ -123,6 +125,7 @@ <h2>Script compression helper</h2>
<option value="http://codemirror.net/mode/htmlembedded/htmlembedded.js">htmlembedded.js</option>
<option value="http://codemirror.net/mode/htmlmixed/htmlmixed.js">htmlmixed.js</option>
<option value="http://codemirror.net/mode/http/http.js">http.js</option>
<option value="http://codemirror.net/mode/idl/idl.js">idl.js</option>
<option value="http://codemirror.net/mode/jade/jade.js">jade.js</option>
<option value="http://codemirror.net/mode/javascript/javascript.js">javascript.js</option>
<option value="http://codemirror.net/mode/jinja2/jinja2.js">jinja2.js</option>
Expand Down
2 changes: 1 addition & 1 deletion doc/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ article > h2:first-child, section:first-child > h2 { margin-top: 0; }
margin-right: 12px;
margin-top: 0;
margin-bottom: 2px;
color: #E30808;
color: #d30707;
letter-spacing: .5px;
}

Expand Down
Binary file modified doc/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading