From 295c1aff82ad31e465c7ba391dde51d818b45a7c Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 22 Apr 2014 14:24:13 +0200 Subject: [PATCH 01/96] Bump version number post-4.1 --- doc/manual.html | 2 +- lib/codemirror.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/manual.html b/doc/manual.html index f47e437ede..910d521ce6 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -63,7 +63,7 @@

User manual and reference guide - version 4.1.0 + version 4.1.1

CodeMirror is a code-editor component that can be embedded in diff --git a/lib/codemirror.js b/lib/codemirror.js index 0ab217711e..e4e92a06f6 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -7520,7 +7520,7 @@ // THE END - CodeMirror.version = "4.1.0"; + CodeMirror.version = "4.1.1"; return CodeMirror; }); diff --git a/package.json b/package.json index 26d7053629..8377f5a93e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codemirror", - "version":"4.1.0", + "version":"4.1.1", "main": "lib/codemirror.js", "description": "In-browser code editing made bearable", "licenses": [{"type": "MIT", From ce4a4d8032105ab25f3065b88f274c56e2ba20c9 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 22 Apr 2014 15:18:39 +0200 Subject: [PATCH 02/96] [livescript mode] Fix empty tokens, clean up style Remove .ls source file --- mode/livescript/livescript.js | 31 +++-- mode/livescript/livescript.ls | 266 ------------------------------------------ 2 files changed, 14 insertions(+), 283 deletions(-) delete mode 100644 mode/livescript/livescript.ls diff --git a/mode/livescript/livescript.js b/mode/livescript/livescript.js index 756181fafb..1efc3ecf66 100644 --- a/mode/livescript/livescript.js +++ b/mode/livescript/livescript.js @@ -11,18 +11,17 @@ else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { -"use strict"; + "use strict"; -(function() { CodeMirror.defineMode('livescript', function(){ - var tokenBase, external; - tokenBase = function(stream, state){ - var next_rule, nr, i$, len$, r, m; - if (next_rule = state.next || 'start') { + var tokenBase = function(stream, state) { + var next_rule = state.next || "start"; + if (next_rule) { state.next = state.next; - if (Array.isArray(nr = Rules[next_rule])) { - for (i$ = 0, len$ = nr.length; i$ < len$; ++i$) { - r = nr[i$]; + var nr = Rules[next_rule]; + if (nr.splice) { + for (var i$ = 0; i$ < nr.length; ++i$) { + var r = nr[i$], m; if (r.regex && (m = stream.match(r.regex))) { state.next = r.next || state.next; return r.token; @@ -44,7 +43,7 @@ stream.next(); return 'error'; }; - external = { + var external = { startState: function(){ return { next: 'start', @@ -52,8 +51,8 @@ }; }, token: function(stream, state){ - var style; - style = tokenBase(stream, state); + while (stream.pos == stream.start) + var style = tokenBase(stream, state); state.lastToken = { style: style, indent: stream.indentation(), @@ -62,8 +61,7 @@ return style.replace(/\./g, ' '); }, indent: function(state){ - var indentation; - indentation = state.lastToken.indent; + var indentation = state.lastToken.indent; if (state.lastToken.content.match(indenter)) { indentation += 2; } @@ -262,7 +260,7 @@ }; for (var idx in Rules) { var r = Rules[idx]; - if (Array.isArray(r)) { + if (r.splice) { for (var i = 0, len = r.length; i < len; ++i) { var rr = r[i]; if (typeof rr.regex === 'string') { @@ -273,8 +271,7 @@ Rules[idx].regex = new RegExp('^' + r.regex); } } -})(); -CodeMirror.defineMIME('text/x-livescript', 'livescript'); + CodeMirror.defineMIME('text/x-livescript', 'livescript'); }); diff --git a/mode/livescript/livescript.ls b/mode/livescript/livescript.ls deleted file mode 100644 index 065242312a..0000000000 --- a/mode/livescript/livescript.ls +++ /dev/null @@ -1,266 +0,0 @@ -/** - * Link to the project's GitHub page: - * https://github.com/duralog/CodeMirror - */ -CodeMirror.defineMode 'livescript', (conf) -> - tokenBase = (stream, state) -> - #indent = - if next_rule = state.next or \start - state.next = state.next - if Array.isArray nr = Rules[next_rule] - for r in nr - if r.regex and m = stream.match r.regex - state.next = r.next - return r.token - stream.next! - return \error - if stream.match r = Rules[next_rule] - if r.regex and stream.match r.regex - state.next = r.next - return r.token - else - stream.next! - return \error - stream.next! - return 'error' - external = { - startState: (basecolumn) -> - { - next: \start - lastToken: null - } - token: (stream, state) -> - style = tokenBase stream, state #tokenLexer stream, state - state.lastToken = { - style: style - indent: stream.indentation! - content: stream.current! - } - style.replace /\./g, ' ' - indent: (state, textAfter) -> - # XXX this won't work with backcalls - indentation = state.lastToken.indent - if state.lastToken.content.match indenter then indentation += 2 - return indentation - } - external - -### Highlight Rules -# taken from mode-ls.ls - -indenter = // (? - : [({[=:] - | [-~]> - | \b (?: e(?:lse|xport) | d(?:o|efault) | t(?:ry|hen) | finally | - import (?:\s* all)? | const | var | - let | new | catch (?:\s* #identifier)? ) - ) \s* $ // - -identifier = /(?![\d\s])[$\w\xAA-\uFFDC](?:(?!\s)[$\w\xAA-\uFFDC]|-[A-Za-z])*/$ -keywordend = /(?![$\w]|-[A-Za-z]|\s*:(?![:=]))/$ -stringfill = token: \string, regex: '.+' - -Rules = - start: - * token: \comment.doc - regex: '/\\*' - next : \comment - - * token: \comment - regex: '#.*' - - * token: \keyword - regex: //(? - :t(?:h(?:is|row|en)|ry|ypeof!?) - |c(?:on(?:tinue|st)|a(?:se|tch)|lass) - |i(?:n(?:stanceof)?|mp(?:ort(?:\s+all)?|lements)|[fs]) - |d(?:e(?:fault|lete|bugger)|o) - |f(?:or(?:\s+own)?|inally|unction) - |s(?:uper|witch) - |e(?:lse|x(?:tends|port)|val) - |a(?:nd|rguments) - |n(?:ew|ot) - |un(?:less|til) - |w(?:hile|ith) - |o[fr]|return|break|let|var|loop - )//$ + keywordend - - * token: \constant.language - regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend - - * token: \invalid.illegal - regex: '(? - :p(?:ackage|r(?:ivate|otected)|ublic) - |i(?:mplements|nterface) - |enum|static|yield - )' + keywordend - - * token: \language.support.class - regex: '(? - :R(?:e(?:gExp|ferenceError)|angeError) - |S(?:tring|yntaxError) - |E(?:rror|valError) - |Array|Boolean|Date|Function|Number|Object|TypeError|URIError - )' + keywordend - - * token: \language.support.function - regex: '(? - :is(?:NaN|Finite) - |parse(?:Int|Float) - |Math|JSON - |(?:en|de)codeURI(?:Component)? - )' + keywordend - - * token: \variable.language - regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend - - * token: \identifier - regex: identifier + /\s*:(?![:=])/$ - - * token: \variable - regex: identifier - - * token: \keyword.operator - regex: /(?:\.{3}|\s+\?)/$ - - * token: \keyword.variable - regex: /(?:@+|::|\.\.)/$ - next : \key - - * token: \keyword.operator - regex: /\.\s*/$ - next : \key - - * token: \string - regex: /\\\S[^\s,;)}\]]*/$ - - * token: \string.doc - regex: \''' - next : \qdoc - - * token: \string.doc - regex: \""" - next : \qqdoc - - * token: \string - regex: \' - next : \qstring - - * token: \string - regex: \" - next : \qqstring - - * token: \string - regex: \` - next : \js - - * token: \string - regex: '<\\[' - next : \words - - * token: \string.regex - regex: \// - next : \heregex - - * token: \string.regex - regex: // - /(?: [^ [ / \n \\ ]* - (?: (?: \\. - | \[ [^\]\n\\]* (?:\\.[^\]\n\\]*)* \] - ) [^ [ / \n \\ ]* - )* - )/ [gimy$]{0,4} - //$ - next : \key - - * token: \constant.numeric - regex: '(?:0x[\\da-fA-F][\\da-fA-F_]* - |(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]* - |(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*) - (?:e[+-]?\\d[\\d_]*)?[\\w$]*)' - - * token: \lparen - regex: '[({[]' - - * token: \rparen - regex: '[)}\\]]' - next : \key - - * token: \keyword.operator - regex: \\\S+ - - * token: \text - regex: \\\s+ - - heregex: - * token: \string.regex - regex: '.*?//[gimy$?]{0,4}' - next : \start - * token: \string.regex - regex: '\\s*#{' - * token: \comment.regex - regex: '\\s+(?:#.*)?' - * token: \string.regex - regex: '\\S+' - - key: - * token: \keyword.operator - regex: '[.?@!]+' - * token: \identifier - regex: identifier - next : \start - * token: \text - regex: '.' - next : \start - - comment: - * token: \comment.doc - regex: '.*?\\*/' - next : \start - * token: \comment.doc - regex: '.+' - - qdoc: - token: \string - regex: ".*?'''" - next : \key - stringfill - - qqdoc: - token: \string - regex: '.*?"""' - next : \key - stringfill - - qstring: - token: \string - regex: /[^\\']*(?:\\.[^\\']*)*'/$ - next : \key - stringfill - - qqstring: - token: \string - regex: /[^\\"]*(?:\\.[^\\"]*)*"/$ - next : \key - stringfill - - js: - token: \string - regex: /[^\\`]*(?:\\.[^\\`]*)*`/$ - next : \key - stringfill - - words: - token: \string - regex: '.*?\\]>' - next : \key - stringfill - -# for optimization, precompile the regexps -for idx, r of Rules - if Array.isArray r - for rr, i in r - if rr.regex then Rules[idx][i].regex = new RegExp '^'+rr.regex - else if r.regex then Rules[idx].regex = new RegExp '^'+r.regex - -CodeMirror.defineMIME 'text/x-livescript', 'livescript' From 513fba04e227bf8cdcf2f9877c7626778243873e Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 22 Apr 2014 16:50:30 +0200 Subject: [PATCH 03/96] Register select-all detection timeout per editor So that a subsequent context menu handler can cancel it Issue #2491 --- lib/codemirror.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index e4e92a06f6..8ca3b12ad7 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -3130,7 +3130,6 @@ // CONTEXT MENU HANDLING - var detectingSelectAll; // To make the context menu work, we need to briefly unhide the // textarea (making it as unobtrusive as possible) to let the // right-click take effect on it. @@ -3180,14 +3179,14 @@ // Try to detect the user choosing select-all if (display.input.selectionStart != null) { if (!ie || ie_upto8) prepareSelectAllHack(); - clearTimeout(detectingSelectAll); + clearTimeout(display.detectingSelectAll); var i = 0, poll = function() { if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0) operation(cm, commands.selectAll)(cm); - else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500); + else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); else resetInput(cm); }; - detectingSelectAll = setTimeout(poll, 200); + display.detectingSelectAll = setTimeout(poll, 200); } } From 6ab1283f659a305b89167bce08b3ccde4d065074 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 22 Apr 2014 17:37:56 +0200 Subject: [PATCH 04/96] More proper prevention of select-all race condition Issue #2491 --- lib/codemirror.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index 8ca3b12ad7..2e615bd74a 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -3158,6 +3158,7 @@ // Adds "Select all" to context menu in FF if (!cm.somethingSelected()) display.input.value = display.prevInput = " "; display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); // Select-all will be greyed out if there's nothing to select, so // this adds a zero-width space so that we can later check whether @@ -3179,7 +3180,6 @@ // Try to detect the user choosing select-all if (display.input.selectionStart != null) { if (!ie || ie_upto8) prepareSelectAllHack(); - clearTimeout(display.detectingSelectAll); var i = 0, poll = function() { if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0) operation(cm, commands.selectAll)(cm); From 708f68cb338bcf577bef1091a7a101b5953edf50 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 23 Apr 2014 13:16:53 +0200 Subject: [PATCH 05/96] Fix logic error in onFocus Issue #2494 --- demo/complete.html | 8 ++++++++ lib/codemirror.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/demo/complete.html b/demo/complete.html index 047a7ecca4..41c244b9a8 100644 --- a/demo/complete.html +++ b/demo/complete.html @@ -75,5 +75,13 @@ extraKeys: {"Ctrl-Space": "autocomplete"}, mode: {name: "javascript", globalVars: true} }); +document.querySelector("img#logo").addEventListener("click", function(e) { + editor.setSelection(CodeMirror.Pos(0, 0), CodeMirror.Pos(0, 10)); + console.log("before focus", editor.display.input.selectionEnd); + editor.focus(); + console.log("after focus", editor.display.input.selectionEnd); + e.stopPropagation(); + e.preventDefault(); +}, false); diff --git a/lib/codemirror.js b/lib/codemirror.js index 2e615bd74a..fa31adc161 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -3110,7 +3110,7 @@ // The prevInput test prevents this from firing when a context // menu is closed (since the resetInput would kill the // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu == cm.doc.sel) { + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { resetInput(cm); if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730 } From 1e3321f4c335569425900ab566a088c896a51ea0 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 23 Apr 2014 13:17:12 +0200 Subject: [PATCH 06/96] Remove debugging code --- demo/complete.html | 8 -------- 1 file changed, 8 deletions(-) diff --git a/demo/complete.html b/demo/complete.html index 41c244b9a8..047a7ecca4 100644 --- a/demo/complete.html +++ b/demo/complete.html @@ -75,13 +75,5 @@ extraKeys: {"Ctrl-Space": "autocomplete"}, mode: {name: "javascript", globalVars: true} }); -document.querySelector("img#logo").addEventListener("click", function(e) { - editor.setSelection(CodeMirror.Pos(0, 0), CodeMirror.Pos(0, 10)); - console.log("before focus", editor.display.input.selectionEnd); - editor.focus(); - console.log("after focus", editor.display.input.selectionEnd); - e.stopPropagation(); - e.preventDefault(); -}, false); From fb1fc604aad3ebd8848b7630947c9b8952add500 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 23 Apr 2014 17:08:28 +0200 Subject: [PATCH 07/96] Prevent select-all hack from confusing readInput when there is a selection Issue #2496 --- lib/codemirror.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/codemirror.js b/lib/codemirror.js index fa31adc161..02c25d40be 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -2246,6 +2246,8 @@ if (withOp) startOperation(cm); cm.display.shift = false; + if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput) + prevInput = "\u200b"; // Find the part of the input that is actually new var same = 0, l = Math.min(prevInput.length, text.length); while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; From 0558dfe76ceae8764011c982d13a766087c9dd20 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 23 Apr 2014 17:12:32 +0200 Subject: [PATCH 08/96] Another fix around the select-all hack Issue #2495 --- lib/codemirror.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/codemirror.js b/lib/codemirror.js index 02c25d40be..ca9be7acab 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -230,6 +230,10 @@ // True when shift is held down. d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; } // STATE UPDATES @@ -3498,6 +3502,7 @@ if (changeHandler) signalLater(cm, "change", cm, obj); if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); } + cm.display.selForContextMenu = null; } function replaceRange(doc, code, from, to, origin) { From 4ea847025f65bc49ea1157100917f5da67433960 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 24 Apr 2014 10:09:27 +0200 Subject: [PATCH 09/96] Scroll change, rather than cursor, into view on undo/redo --- lib/codemirror.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index ca9be7acab..f636832fff 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -3388,7 +3388,7 @@ var after = i ? computeSelAfterChange(doc, change, null) : lst(source); makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (doc.cm) ensureCursorVisible(doc.cm); + if (!i && doc.cm) doc.cm.scrollIntoView(change); var rebased = []; // Propagate to the linked documents From 068227e4e9dd04c29da343ac2440c6b9a6e945ba Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 24 Apr 2014 10:22:06 +0200 Subject: [PATCH 10/96] Fall back to nullRect in measureCharInner to work around Safari issue Issue #2492 --- lib/codemirror.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index f636832fff..0aec28d822 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -1625,7 +1625,7 @@ else rect = nullRect; } else { - rect = range(node, start, end).getBoundingClientRect(); + rect = range(node, start, end).getBoundingClientRect() || nullRect; } } else { // If it is a widget, simply get the box for the whole widget. if (start > 0) collapse = bias = "right"; From 9fa870fef10b8389e0592cd0b6b831bc265b1839 Mon Sep 17 00:00:00 2001 From: Forbes Lindesay Date: Tue, 22 Apr 2014 14:56:25 +0100 Subject: [PATCH 11/96] [jade mode] Re-write to match the jade lexer --- mode/jade/index.html | 8 +- mode/jade/jade.js | 650 ++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 574 insertions(+), 84 deletions(-) diff --git a/mode/jade/index.html b/mode/jade/index.html index e22b15e65b..8bfd5620c0 100644 --- a/mode/jade/index.html +++ b/mode/jade/index.html @@ -6,6 +6,10 @@ + + + +

]", + "[link ]", + "[tag&bracket <][tag div][tag&bracket >]", + "[tag&bracket ]"); + })(); From 60ab165bfa2bfc81b97d3b2b2d16c9665002adf5 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 6 May 2014 11:04:27 +0200 Subject: [PATCH 62/96] [dylan mode] Add module loading shim Closes #2533 --- mode/dylan/dylan.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mode/dylan/dylan.js b/mode/dylan/dylan.js index d81ef0cbcb..ccf9679181 100644 --- a/mode/dylan/dylan.js +++ b/mode/dylan/dylan.js @@ -1,3 +1,13 @@ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + CodeMirror.defineMode("dylan", function(_config) { // Words var words = { @@ -282,3 +292,5 @@ CodeMirror.defineMode("dylan", function(_config) { }); CodeMirror.defineMIME("text/x-dylan", "dylan"); + +}); From 6abb339705fd234de93b14c28f37a5a212b65629 Mon Sep 17 00:00:00 2001 From: binny Date: Mon, 5 May 2014 21:55:30 +0530 Subject: [PATCH 63/96] [vim] Visual paste operation with unit tests --- keymap/vim.js | 61 ++++++++++++++++++++++++++++++++++---------------------- test/vim_test.js | 25 +++++++++++++++++++++++ 2 files changed, 62 insertions(+), 24 deletions(-) diff --git a/keymap/vim.js b/keymap/vim.js index c78d76af94..1ea39c1ef0 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -2051,7 +2051,7 @@ } this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim); }, - paste: function(cm, actionArgs) { + paste: function(cm, actionArgs, vim) { var cur = copyCursor(cm.getCursor()); var register = vimGlobalState.registerController.getRegister( actionArgs.registerName); @@ -2092,7 +2092,9 @@ } var linewise = register.linewise; if (linewise) { - if (actionArgs.after) { + if(vim.visualMode) { + text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; + } else if (actionArgs.after) { // Move the newline at the end to the start instead, and paste just // before the newline character of the line we are on right now. text = '\n' + text.slice(0, text.length - 1); @@ -2103,24 +2105,35 @@ } else { cur.ch += actionArgs.after ? 1 : 0; } - cm.replaceRange(text, cur); - // Now fine tune the cursor to where we want it. var curPosFinal; var idx; - if (linewise && actionArgs.after) { - curPosFinal = Pos( - cur.line + 1, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); - } else if (linewise && !actionArgs.after) { - curPosFinal = Pos( - cur.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))); - } else if (!linewise && actionArgs.after) { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length - 1); + if (vim.visualMode) { + var selectedArea = getSelectedAreaRange(cm, vim); + var selectionStart = selectedArea[0]; + var selectionEnd = selectedArea[1]; + // push the previously selected text to unnamed register + vimGlobalState.registerController.unnamedRegister.setText(cm.getRange(selectionStart, selectionEnd)); + cm.replaceRange(text, selectionStart, selectionEnd); + curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1); + if(linewise)curPosFinal.ch=0; } else { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length); + cm.replaceRange(text, cur); + // Now fine tune the cursor to where we want it. + if (linewise && actionArgs.after) { + curPosFinal = Pos( + cur.line + 1, + findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); + } else if (linewise && !actionArgs.after) { + curPosFinal = Pos( + cur.line, + findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))); + } else if (!linewise && actionArgs.after) { + idx = cm.indexFromPos(cur); + curPosFinal = cm.posFromIndex(idx + text.length - 1); + } else { + idx = cm.indexFromPos(cur); + curPosFinal = cm.posFromIndex(idx + text.length); + } } cm.setCursor(curPosFinal); }, @@ -2220,13 +2233,6 @@ var selectionStart = selectedAreaRange[0]; var selectionEnd = selectedAreaRange[1]; var toLower = actionArgs.toLower; - if (cursorIsBefore(selectionEnd, selectionStart)) { - var tmp = selectionStart; - selectionStart = selectionEnd; - selectionEnd = tmp; - } else { - selectionEnd = cm.clipPos(Pos(selectionEnd.line, selectionEnd.ch+1)); - } var text = cm.getRange(selectionStart, selectionEnd); cm.replaceRange(toLower ? text.toLowerCase() : text.toUpperCase(), selectionStart, selectionEnd); cm.setCursor(selectionStart); @@ -2324,6 +2330,13 @@ return [{line: selectionStart.line, ch: 0}, {line: selectionEnd.line, ch: lineLength(cm, selectionEnd.line)}]; } } else { + if (cursorIsBefore(selectionEnd, selectionStart)) { + var tmp = selectionStart; + selectionStart = selectionEnd; + selectionEnd = tmp; + } else { + selectionEnd = cm.clipPos(Pos(selectionEnd.line, selectionEnd.ch+1)); + } exitVisualMode(cm); } return [selectionStart, selectionEnd]; diff --git a/test/vim_test.js b/test/vim_test.js index 71cd5ed941..a3f3fed3ad 100644 --- a/test/vim_test.js +++ b/test/vim_test.js @@ -1639,6 +1639,31 @@ testVim('uppercase/lowercase_visual', function(cm, vim, helpers) { helpers.doKeys('V', 'U', 'j', '.'); eq('ABCDEF\nGHIJKL\nMnopq\nSHORT LINE\nLONG LINE OF TEXT', cm.getValue()); }, { value: 'abcdef\nghijkl\nmnopq\nshort line\nlong line of text'}); +testVim('visual_paste', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('v', 'l', 'l', 'y', 'j', 'v', 'l', 'p'); + helpers.assertCursorAt(1, 4); + eq('this is a\nunthi test for visual paste', cm.getValue()); + cm.setCursor(0, 0); + // in case of pasting whole line + helpers.doKeys('y', 'y'); + cm.setCursor(1, 6); + helpers.doKeys('v', 'l', 'l', 'l', 'p'); + helpers.assertCursorAt(2, 0); + eq('this is a\nunthi \nthis is a\n for visual paste', cm.getValue()); +}, { value: 'this is a\nunit test for visual paste'}); + +// This checks the contents of the register used to paste the text +testVim('v_paste_from_register', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('"', 'a', 'y', 'w'); + cm.setCursor(1, 0); + helpers.doKeys('v', 'p'); + cm.openDialog = helpers.fakeOpenDialog('registers'); + cm.openNotification = helpers.fakeOpenNotification(function(text) { + is(/a\s+register/.test(text)); + }); +}, { value: 'register contents\nare not erased'}); testVim('S_normal', function(cm, vim, helpers) { cm.setCursor(0, 1); helpers.doKeys('j', 'S'); From 6db5ec2870fc78977c817e35440185e26bff9175 Mon Sep 17 00:00:00 2001 From: binny Date: Wed, 30 Apr 2014 06:01:39 +0530 Subject: [PATCH 64/96] [vim] support for append action command in visual mode added --- keymap/vim.js | 8 ++++++++ test/vim_test.js | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/keymap/vim.js b/keymap/vim.js index 1ea39c1ef0..c48506adaa 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -271,6 +271,7 @@ actionArgs: { insertAt: 'charAfter' }}, { keys: ['A'], type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }}, + { keys: ['A'], type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' }, { keys: ['i'], type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }}, { keys: ['I'], type: 'action', action: 'enterInsertMode', isEdit: true, @@ -1914,6 +1915,13 @@ cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); } else if (insertAt == 'firstNonBlank') { cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm)); + } else if (insertAt == 'endOfSelectedArea') { + var selectionEnd = cm.getCursor('head'); + var selectionStart = cm.getCursor('anchor'); + var cursor = cm.getCursor(); + cursor = cursorIsBefore(selectionStart, selectionEnd) ? Pos(cursor.line, selectionEnd.ch+1) : Pos(cursor.line, selectionEnd.ch); + cm.setCursor(cursor); + exitVisualMode(cm); } cm.setOption('keyMap', 'vim-insert'); cm.setOption('disableInput', false); diff --git a/test/vim_test.js b/test/vim_test.js index a3f3fed3ad..fecc52ba35 100644 --- a/test/vim_test.js +++ b/test/vim_test.js @@ -1141,6 +1141,13 @@ testVim('a_eol', function(cm, vim, helpers) { helpers.assertCursorAt(0, lines[0].length); eq('vim-insert', cm.getOption('keyMap')); }); +testVim('a_endOfSelectedArea', function(cm, vim, helpers) { + cm.setCursor(0, 0); + helpers.doKeys('v', 'j', 'l'); + helpers.doKeys('A'); + helpers.assertCursorAt(1, 2); + eq('vim-insert', cm.getOption('keyMap')); +}, {value: 'foo\nbar'}); testVim('i', function(cm, vim, helpers) { cm.setCursor(0, 1); helpers.doKeys('i'); From 546eb6ce365d860d1649f0b6e22cd6b1f7879a21 Mon Sep 17 00:00:00 2001 From: binny Date: Fri, 2 May 2014 03:32:33 +0530 Subject: [PATCH 65/96] [vim] Resolve upward selection bug --- keymap/vim.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/keymap/vim.js b/keymap/vim.js index c48506adaa..e33d269089 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -1918,9 +1918,8 @@ } else if (insertAt == 'endOfSelectedArea') { var selectionEnd = cm.getCursor('head'); var selectionStart = cm.getCursor('anchor'); - var cursor = cm.getCursor(); - cursor = cursorIsBefore(selectionStart, selectionEnd) ? Pos(cursor.line, selectionEnd.ch+1) : Pos(cursor.line, selectionEnd.ch); - cm.setCursor(cursor); + selectionEnd = cursorIsBefore(selectionStart, selectionEnd) ? Pos(selectionEnd.line, selectionEnd.ch+1) : (selectionEnd.line < selectionStart.line ? Pos(selectionStart.line, 0) : selectionEnd); + cm.setCursor(selectionEnd); exitVisualMode(cm); } cm.setOption('keyMap', 'vim-insert'); From 41a29b0132445f8f10a5fc4b83f7c1e456171d03 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 8 May 2014 12:22:20 +0200 Subject: [PATCH 66/96] Abort wheel delta measurement when scrolling explicitly Issue #2537 --- lib/codemirror.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/codemirror.js b/lib/codemirror.js index 4a843d3f63..0bf6f2d8e8 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -1927,6 +1927,10 @@ if (!updated && op.selectionChanged) updateSelection(cm); if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm); + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + display.wheelStartX = display.wheelStartY = null; + // Propagate the scroll position to the actual DOM scroller if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) { var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); From 0efe7a57115a252abf033e16ea1d1a375cd5a229 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 9 May 2014 14:48:38 +0200 Subject: [PATCH 67/96] [sublime keybindings] Don't include zero-char selection bottoms in swapLine* Issue #2542 --- keymap/sublime.js | 16 ++++++++-------- test/sublime_test.js | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/keymap/sublime.js b/keymap/sublime.js index eea46347fd..9158e27944 100644 --- a/keymap/sublime.js +++ b/keymap/sublime.js @@ -184,9 +184,12 @@ }; cmds[map["Shift-" + ctrl + "Up"] = "swapLineUp"] = function(cm) { - var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1; + var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = []; for (var i = 0; i < ranges.length; i++) { var range = ranges[i], from = range.from().line - 1, to = range.to().line; + newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch), + head: Pos(range.head.line - 1, range.head.ch)}); + if (range.to().ch == 0 && !range.empty()) --to; if (from > at) linesToMove.push(from, to); else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; at = to; @@ -196,16 +199,12 @@ var from = linesToMove[i], to = linesToMove[i + 1]; var line = cm.getLine(from); cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine"); - if (to > cm.lastLine()) { + if (to > cm.lastLine()) cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine"); - var sels = cm.listSelections(), last = sels[sels.length - 1]; - var head = last.head.line == to ? Pos(to - 1) : last.head; - var anchor = last.anchor.line == to ? Pos(to - 1) : last.anchor; - cm.setSelections(sels.slice(0, sels.length - 1).concat([{head: head, anchor: anchor}])); - } else { + else cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine"); - } } + cm.setSelections(newSels); cm.scrollIntoView(); }); }; @@ -214,6 +213,7 @@ var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1; for (var i = ranges.length - 1; i >= 0; i--) { var range = ranges[i], from = range.to().line + 1, to = range.from().line; + if (range.to().ch == 0 && !range.empty()) from--; if (from < at) linesToMove.push(from, to); else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to; at = to; diff --git a/test/sublime_test.js b/test/sublime_test.js index f09504c51a..c93e041b87 100644 --- a/test/sublime_test.js +++ b/test/sublime_test.js @@ -178,6 +178,12 @@ 1, 0, 2, 0, 2, 2, 2, 2)); + stTest("swapLineEmptyBottomSel", "1\n2\n3", + setSel(0, 1, 1, 0), + "swapLineDown", val("2\n1\n3"), hasSel(1, 1, 2, 0), + "swapLineUp", val("1\n2\n3"), hasSel(0, 1, 1, 0), + "swapLineUp", val("1\n2\n3"), hasSel(0, 0, 0, 0)); + stTest("swapLineUpFromEnd", "a\nb\nc", Pos(2, 1), "swapLineUp", hasSel(1, 1, 1, 1), val("a\nc\nb")); From fea31914767042d0d42800ab82dc29b3e76a6a2b Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 9 May 2014 15:18:36 +0200 Subject: [PATCH 68/96] [javascript-hint addon] Support an option that disables use of the current global scope --- addon/hint/javascript-hint.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addon/hint/javascript-hint.js b/addon/hint/javascript-hint.js index 305bb85a29..baf20b45dc 100644 --- a/addon/hint/javascript-hint.js +++ b/addon/hint/javascript-hint.js @@ -108,7 +108,8 @@ if (obj.type && obj.type.indexOf("variable") === 0) { if (options && options.additionalContext) base = options.additionalContext[obj.string]; - base = base || window[obj.string]; + if (!options || options.useGlobalScope !== false) + base = base || window[obj.string]; } else if (obj.type == "string") { base = ""; } else if (obj.type == "atom") { @@ -128,7 +129,8 @@ // (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); - gatherCompletions(window); + if (!options || options.useGlobalScope !== false) + gatherCompletions(window); forEach(keywords, maybeAdd); } return found; From a6faf989152a86a22f6155a775f3c16d724d1a88 Mon Sep 17 00:00:00 2001 From: Bem Jones-Bey Date: Tue, 6 May 2014 15:00:32 -0700 Subject: [PATCH 69/96] [css mode] Add more CSS Shapes properties Add shape-image-threshold and shape-margin. --- mode/css/css.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mode/css/css.js b/mode/css/css.js index 3fae9687fd..8828329fc4 100644 --- a/mode/css/css.js +++ b/mode/css/css.js @@ -433,8 +433,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "region-break-before", "region-break-inside", "region-fragment", "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", - "ruby-position", "ruby-span", "shape-inside", "shape-outside", "size", - "speak", "speak-as", "speak-header", + "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", + "shape-outside", "size", "speak", "speak-as", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", "tab-size", "table-layout", "target", "target-name", "target-new", "target-position", "text-align", "text-align-last", "text-decoration", From 81aeea3757b2c9826af68fb21fd5a170684f0aac Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 9 May 2014 15:24:47 +0200 Subject: [PATCH 70/96] [real-world uses] Add Better Text Viewer and CrossUI --- doc/realworld.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/realworld.html b/doc/realworld.html index ccfbf4be41..e6649b1f02 100644 --- a/doc/realworld.html +++ b/doc/realworld.html @@ -28,6 +28,7 @@
  • Adobe Brackets (code editor)
  • Amber (JavaScript-based Smalltalk system)
  • APEye (tool for testing & documenting APIs)
  • +
  • Better Text Viewer (plain text reader app for Chrome)
  • Bitbucket (code hosting)
  • Blogger's template editor
  • BlueGriffon (HTML editor)
  • @@ -35,6 +36,7 @@
  • Chrome DevTools
  • ClickHelp (technical writing tool)
  • Complete.ly playground
  • +
  • CrossUI (cross-platform UI builder)
  • Cruncher (notepad with calculation features)
  • Code per Node (Drupal module)
  • Codebug (PHP Xdebug front-end)
  • From 01e844f09eb74ad55a987779ead1c1fb17d5aea9 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 9 May 2014 15:52:39 +0200 Subject: [PATCH 71/96] Add license and version comment to all scripts --- addon/comment/comment.js | 3 +++ addon/comment/continuecomment.js | 3 +++ addon/dialog/dialog.js | 3 +++ addon/display/fullscreen.js | 3 +++ addon/display/placeholder.js | 3 +++ addon/display/rulers.js | 3 +++ addon/edit/closebrackets.js | 3 +++ addon/edit/closetag.js | 3 +++ addon/edit/continuelist.js | 3 +++ addon/edit/matchbrackets.js | 3 +++ addon/edit/matchtags.js | 3 +++ addon/edit/trailingspace.js | 3 +++ addon/fold/brace-fold.js | 3 +++ addon/fold/comment-fold.js | 3 +++ addon/fold/foldcode.js | 3 +++ addon/fold/foldgutter.js | 3 +++ addon/fold/indent-fold.js | 3 +++ addon/fold/markdown-fold.js | 3 +++ addon/fold/xml-fold.js | 3 +++ addon/hint/anyword-hint.js | 3 +++ addon/hint/css-hint.js | 3 +++ addon/hint/html-hint.js | 3 +++ addon/hint/javascript-hint.js | 3 +++ addon/hint/python-hint.js | 3 +++ addon/hint/show-hint.js | 3 +++ addon/hint/sql-hint.js | 3 +++ addon/hint/xml-hint.js | 3 +++ addon/lint/coffeescript-lint.js | 3 +++ addon/lint/css-lint.js | 3 +++ addon/lint/javascript-lint.js | 3 +++ addon/lint/json-lint.js | 3 +++ addon/lint/lint.js | 3 +++ addon/lint/yaml-lint.js | 3 +++ addon/merge/merge.js | 3 +++ addon/mode/loadmode.js | 3 +++ addon/mode/multiplex.js | 3 +++ addon/mode/multiplex_test.js | 3 +++ addon/mode/overlay.js | 3 +++ addon/runmode/colorize.js | 3 +++ addon/runmode/runmode-standalone.js | 3 +++ addon/runmode/runmode.js | 3 +++ addon/runmode/runmode.node.js | 3 +++ addon/scroll/scrollpastend.js | 3 +++ addon/search/match-highlighter.js | 3 +++ addon/search/search.js | 3 +++ addon/search/searchcursor.js | 3 +++ addon/selection/active-line.js | 3 +++ addon/selection/mark-selection.js | 3 +++ addon/tern/tern.js | 3 +++ addon/tern/worker.js | 3 +++ addon/wrap/hardwrap.js | 3 +++ bin/release | 15 +++++++++++++++ keymap/emacs.js | 3 +++ keymap/sublime.js | 3 +++ keymap/vim.js | 3 +++ lib/codemirror.js | 3 +++ mode/apl/apl.js | 3 +++ mode/asterisk/asterisk.js | 3 +++ mode/clike/clike.js | 3 +++ mode/clojure/clojure.js | 3 +++ mode/cobol/cobol.js | 3 +++ mode/coffeescript/coffeescript.js | 3 +++ mode/commonlisp/commonlisp.js | 3 +++ mode/css/css.js | 3 +++ mode/css/less_test.js | 3 +++ mode/css/scss_test.js | 3 +++ mode/css/test.js | 3 +++ mode/cypher/cypher.js | 3 +++ mode/d/d.js | 3 +++ mode/diff/diff.js | 3 +++ mode/django/django.js | 3 +++ mode/dtd/dtd.js | 3 +++ mode/dylan/dylan.js | 3 +++ mode/ecl/ecl.js | 3 +++ mode/eiffel/eiffel.js | 3 +++ mode/erlang/erlang.js | 3 +++ mode/fortran/fortran.js | 3 +++ mode/gas/gas.js | 3 +++ mode/gfm/gfm.js | 3 +++ mode/gfm/test.js | 3 +++ mode/gherkin/gherkin.js | 3 +++ mode/go/go.js | 3 +++ mode/groovy/groovy.js | 3 +++ mode/haml/haml.js | 3 +++ mode/haml/test.js | 3 +++ mode/haskell/haskell.js | 3 +++ mode/haxe/haxe.js | 3 +++ mode/htmlembedded/htmlembedded.js | 3 +++ mode/htmlmixed/htmlmixed.js | 3 +++ mode/http/http.js | 3 +++ mode/jade/jade.js | 3 +++ mode/javascript/javascript.js | 3 +++ mode/javascript/test.js | 3 +++ mode/jinja2/jinja2.js | 3 +++ mode/julia/julia.js | 3 +++ mode/livescript/livescript.js | 3 +++ mode/lua/lua.js | 3 +++ mode/markdown/markdown.js | 3 +++ mode/markdown/test.js | 3 +++ mode/meta.js | 3 +++ mode/mirc/mirc.js | 3 +++ mode/mllike/mllike.js | 3 +++ mode/nginx/nginx.js | 3 +++ mode/ntriples/ntriples.js | 3 +++ mode/octave/octave.js | 3 +++ mode/pascal/pascal.js | 3 +++ mode/pegjs/pegjs.js | 3 +++ mode/perl/perl.js | 3 +++ mode/php/php.js | 3 +++ mode/php/test.js | 3 +++ mode/pig/pig.js | 3 +++ mode/properties/properties.js | 3 +++ mode/puppet/puppet.js | 3 +++ mode/python/python.js | 3 +++ mode/q/q.js | 3 +++ mode/r/r.js | 3 +++ mode/rpm/rpm.js | 3 +++ mode/rst/rst.js | 3 +++ mode/ruby/ruby.js | 3 +++ mode/ruby/test.js | 3 +++ mode/rust/rust.js | 3 +++ mode/sass/sass.js | 3 +++ mode/scheme/scheme.js | 3 +++ mode/shell/shell.js | 3 +++ mode/shell/test.js | 3 +++ mode/sieve/sieve.js | 3 +++ mode/smalltalk/smalltalk.js | 3 +++ mode/smarty/smarty.js | 3 +++ mode/smartymixed/smartymixed.js | 3 +++ mode/solr/solr.js | 3 +++ mode/sparql/sparql.js | 3 +++ mode/sql/sql.js | 3 +++ mode/stex/stex.js | 3 +++ mode/stex/test.js | 3 +++ mode/tcl/tcl.js | 3 +++ mode/tiddlywiki/tiddlywiki.js | 3 +++ mode/tiki/tiki.js | 3 +++ mode/toml/toml.js | 3 +++ mode/turtle/turtle.js | 3 +++ mode/vb/vb.js | 3 +++ mode/vbscript/vbscript.js | 3 +++ mode/velocity/velocity.js | 3 +++ mode/verilog/test.js | 3 +++ mode/verilog/verilog.js | 3 +++ mode/xml/test.js | 3 +++ mode/xml/xml.js | 3 +++ mode/xquery/test.js | 3 +++ mode/xquery/xquery.js | 3 +++ mode/yaml/yaml.js | 3 +++ mode/z80/z80.js | 3 +++ test/lint/lint.js | 7 ++++++- 151 files changed, 468 insertions(+), 1 deletion(-) diff --git a/addon/comment/comment.js b/addon/comment/comment.js index 1eb9a05c5d..f56721206e 100644 --- a/addon/comment/comment.js +++ b/addon/comment/comment.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/comment/continuecomment.js b/addon/comment/continuecomment.js index 42277267f5..5247a845c4 100644 --- a/addon/comment/continuecomment.js +++ b/addon/comment/continuecomment.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/dialog/dialog.js b/addon/dialog/dialog.js index 586b7370dc..8fbdea168d 100644 --- a/addon/dialog/dialog.js +++ b/addon/dialog/dialog.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Open simple dialogs on top of an editor. Relies on dialog.css. (function(mod) { diff --git a/addon/display/fullscreen.js b/addon/display/fullscreen.js index e39c6e162f..e7f22a7936 100644 --- a/addon/display/fullscreen.js +++ b/addon/display/fullscreen.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/display/placeholder.js b/addon/display/placeholder.js index 0fdc9b0d5b..fbc0a8bdf0 100644 --- a/addon/display/placeholder.js +++ b/addon/display/placeholder.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/display/rulers.js b/addon/display/rulers.js index 42cc2b9a90..e025415b51 100644 --- a/addon/display/rulers.js +++ b/addon/display/rulers.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/edit/closebrackets.js b/addon/edit/closebrackets.js index 3cea887d1d..4caac60b98 100644 --- a/addon/edit/closebrackets.js +++ b/addon/edit/closebrackets.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/edit/closetag.js b/addon/edit/closetag.js index c7c0701ba5..d64045ab1b 100644 --- a/addon/edit/closetag.js +++ b/addon/edit/closetag.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Tag-closer extension for CodeMirror. * diff --git a/addon/edit/continuelist.js b/addon/edit/continuelist.js index 2946aa6a24..3dcf757397 100644 --- a/addon/edit/continuelist.js +++ b/addon/edit/continuelist.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/edit/matchbrackets.js b/addon/edit/matchbrackets.js index dcdde81dfe..c1221ca4c0 100644 --- a/addon/edit/matchbrackets.js +++ b/addon/edit/matchbrackets.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/edit/matchtags.js b/addon/edit/matchtags.js index 76a7b87c9a..a91d578365 100644 --- a/addon/edit/matchtags.js +++ b/addon/edit/matchtags.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../fold/xml-fold")); diff --git a/addon/edit/trailingspace.js b/addon/edit/trailingspace.js index ec07221e30..e12162d33c 100644 --- a/addon/edit/trailingspace.js +++ b/addon/edit/trailingspace.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/fold/brace-fold.js b/addon/fold/brace-fold.js index f0ee62029a..a0161e2c19 100644 --- a/addon/fold/brace-fold.js +++ b/addon/fold/brace-fold.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/fold/comment-fold.js b/addon/fold/comment-fold.js index d72c5479a7..593539affd 100644 --- a/addon/fold/comment-fold.js +++ b/addon/fold/comment-fold.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/fold/foldcode.js b/addon/fold/foldcode.js index 81094e2543..51cc3939b3 100644 --- a/addon/fold/foldcode.js +++ b/addon/fold/foldcode.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/fold/foldgutter.js b/addon/fold/foldgutter.js index 9caba59aad..04ce8493e8 100644 --- a/addon/fold/foldgutter.js +++ b/addon/fold/foldgutter.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("./foldcode")); diff --git a/addon/fold/indent-fold.js b/addon/fold/indent-fold.js index d0130836a2..126ed4953c 100644 --- a/addon/fold/indent-fold.js +++ b/addon/fold/indent-fold.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/fold/markdown-fold.js b/addon/fold/markdown-fold.js index 3bbf5b6077..ecee9e7e27 100644 --- a/addon/fold/markdown-fold.js +++ b/addon/fold/markdown-fold.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/fold/xml-fold.js b/addon/fold/xml-fold.js index d554e2fc42..e1fd5756d8 100644 --- a/addon/fold/xml-fold.js +++ b/addon/fold/xml-fold.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/hint/anyword-hint.js b/addon/hint/anyword-hint.js index 3ef979b524..0b6d872f3d 100644 --- a/addon/hint/anyword-hint.js +++ b/addon/hint/anyword-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/hint/css-hint.js b/addon/hint/css-hint.js index 96d9d52e1b..a93458819c 100644 --- a/addon/hint/css-hint.js +++ b/addon/hint/css-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../../mode/css/css")); diff --git a/addon/hint/html-hint.js b/addon/hint/html-hint.js index cbe7c61ad4..cfdcff9de2 100755 --- a/addon/hint/html-hint.js +++ b/addon/hint/html-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/hint/javascript-hint.js b/addon/hint/javascript-hint.js index baf20b45dc..29f3960902 100644 --- a/addon/hint/javascript-hint.js +++ b/addon/hint/javascript-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/hint/python-hint.js b/addon/hint/python-hint.js index eebfcc76dc..49dfb08f3a 100644 --- a/addon/hint/python-hint.js +++ b/addon/hint/python-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/hint/show-hint.js b/addon/hint/show-hint.js index 46b55648cb..4bede1fb03 100644 --- a/addon/hint/show-hint.js +++ b/addon/hint/show-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/hint/sql-hint.js b/addon/hint/sql-hint.js index a48d2b3cea..e527a878b9 100644 --- a/addon/hint/sql-hint.js +++ b/addon/hint/sql-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../../mode/sql/sql")); diff --git a/addon/hint/xml-hint.js b/addon/hint/xml-hint.js index 9cfd1e884f..de9f79eb3b 100644 --- a/addon/hint/xml-hint.js +++ b/addon/hint/xml-hint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/lint/coffeescript-lint.js b/addon/lint/coffeescript-lint.js index 6df17f8f84..2cc6314f06 100644 --- a/addon/lint/coffeescript-lint.js +++ b/addon/lint/coffeescript-lint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js // declare global: coffeelint diff --git a/addon/lint/css-lint.js b/addon/lint/css-lint.js index de9cd20d7a..93f2e5f5d8 100644 --- a/addon/lint/css-lint.js +++ b/addon/lint/css-lint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Depends on csslint.js from https://github.com/stubbornella/csslint // declare global: CSSLint diff --git a/addon/lint/javascript-lint.js b/addon/lint/javascript-lint.js index 86c863a4a2..ed62dd989c 100644 --- a/addon/lint/javascript-lint.js +++ b/addon/lint/javascript-lint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/lint/json-lint.js b/addon/lint/json-lint.js index 1f5f82d0ca..b548a8e439 100644 --- a/addon/lint/json-lint.js +++ b/addon/lint/json-lint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Depends on jsonlint.js from https://github.com/zaach/jsonlint // declare global: jsonlint diff --git a/addon/lint/lint.js b/addon/lint/lint.js index 393a689036..1682acf6ea 100644 --- a/addon/lint/lint.js +++ b/addon/lint/lint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/lint/yaml-lint.js b/addon/lint/yaml-lint.js index b53673af4b..3ada0eaf9f 100644 --- a/addon/lint/yaml-lint.js +++ b/addon/lint/yaml-lint.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/merge/merge.js b/addon/merge/merge.js index fe3fcf4282..61e25e5d36 100644 --- a/addon/merge/merge.js +++ b/addon/merge/merge.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/mode/loadmode.js b/addon/mode/loadmode.js index e08c281321..e49421b8fc 100644 --- a/addon/mode/loadmode.js +++ b/addon/mode/loadmode.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/mode/multiplex.js b/addon/mode/multiplex.js index 07385c35f2..40601f4dfa 100644 --- a/addon/mode/multiplex.js +++ b/addon/mode/multiplex.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/mode/multiplex_test.js b/addon/mode/multiplex_test.js index c0656357c7..a10012ce8c 100644 --- a/addon/mode/multiplex_test.js +++ b/addon/mode/multiplex_test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { CodeMirror.defineMode("markdown_with_stex", function(){ var inner = CodeMirror.getMode({}, "stex"); diff --git a/addon/mode/overlay.js b/addon/mode/overlay.js index e32fa830b3..82f754c461 100644 --- a/addon/mode/overlay.js +++ b/addon/mode/overlay.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Utility function that allows modes to be combined. The mode given // as the base argument takes care of most of the normal mode // functionality, but a second (typically simple) mode is used, which diff --git a/addon/runmode/colorize.js b/addon/runmode/colorize.js index 0f9530b17b..eb99f29945 100644 --- a/addon/runmode/colorize.js +++ b/addon/runmode/colorize.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("./runmode")); diff --git a/addon/runmode/runmode-standalone.js b/addon/runmode/runmode-standalone.js index e36e00fbc6..3e1e746e95 100644 --- a/addon/runmode/runmode-standalone.js +++ b/addon/runmode/runmode-standalone.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + window.CodeMirror = {}; (function() { diff --git a/addon/runmode/runmode.js b/addon/runmode/runmode.js index 5592a99a60..5406ff72fd 100644 --- a/addon/runmode/runmode.js +++ b/addon/runmode/runmode.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/runmode/runmode.node.js b/addon/runmode/runmode.node.js index 15bf392313..f8c467f381 100644 --- a/addon/runmode/runmode.node.js +++ b/addon/runmode/runmode.node.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* Just enough of CodeMirror to run runMode under node.js */ // declare global: StringStream diff --git a/addon/scroll/scrollpastend.js b/addon/scroll/scrollpastend.js index 467b7aa1cf..e9f4ecb68a 100644 --- a/addon/scroll/scrollpastend.js +++ b/addon/scroll/scrollpastend.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/search/match-highlighter.js b/addon/search/match-highlighter.js index 83ab8c33c7..0dc28c10ba 100644 --- a/addon/search/match-highlighter.js +++ b/addon/search/match-highlighter.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Highlighting text that matches the selection // // Defines an option highlightSelectionMatches, which, when enabled, diff --git a/addon/search/search.js b/addon/search/search.js index 7a1db6ee09..7bc3414c7b 100644 --- a/addon/search/search.js +++ b/addon/search/search.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Define search commands. Depends on dialog.js or another // implementation of the openDialog method. diff --git a/addon/search/searchcursor.js b/addon/search/searchcursor.js index 899f44c4ab..f6df00a94e 100644 --- a/addon/search/searchcursor.js +++ b/addon/search/searchcursor.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/addon/selection/active-line.js b/addon/selection/active-line.js index a818f109b6..bafcb6b8c3 100644 --- a/addon/selection/active-line.js +++ b/addon/selection/active-line.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Because sometimes you need to style the cursor's line. // // Adds an option 'styleActiveLine' which, when enabled, gives the diff --git a/addon/selection/mark-selection.js b/addon/selection/mark-selection.js index ae0d393143..f621c0704a 100644 --- a/addon/selection/mark-selection.js +++ b/addon/selection/mark-selection.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Because sometimes you need to mark the selected *text*. // // Adds an option 'styleSelectedText' which, when enabled, gives diff --git a/addon/tern/tern.js b/addon/tern/tern.js index 2f450ed024..318f1484d9 100644 --- a/addon/tern/tern.js +++ b/addon/tern/tern.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Glue code between CodeMirror and Tern. // // Create a CodeMirror.TernServer to wrap an actual Tern server, diff --git a/addon/tern/worker.js b/addon/tern/worker.js index 1ff63de411..615ce61e6a 100644 --- a/addon/tern/worker.js +++ b/addon/tern/worker.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // declare global: tern, server var server; diff --git a/addon/wrap/hardwrap.js b/addon/wrap/hardwrap.js index 87aab1b8f6..fb0b5f2fcf 100644 --- a/addon/wrap/hardwrap.js +++ b/addon/wrap/hardwrap.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/bin/release b/bin/release index 3c33290f3f..91451faae5 100755 --- a/bin/release +++ b/bin/release @@ -27,6 +27,21 @@ rewrite("doc/manual.html", function(manual) { return manual.replace(/>version \d+\.\d+\.\d+<\/span>/, ">version " + number + ""); }); +function walkDir(dir) { + fs.readdirSync(dir).forEach(function(file) { + var fname = dir + "/" + file; + if (/\.js$/.test(file)) rewrite(file, function(script) { + return script.replace(/^\/\/ CodeMirror \d+\.\d+\.\d+, copyright/, + "// CodeMirror " + number + ", copyright"); + }); + else if (fs.lstatSync(fname).isDirectory()) walkDir(fname); + }); +} +walkDir("mode"); +walkDir("lib"); +walkDir("addon"); +walkDir("keymap"); + if (bumpOnly) process.exit(0); child.exec("bash bin/authors.sh", function(){}); diff --git a/keymap/emacs.js b/keymap/emacs.js index 7cecf1f627..b1b70254d8 100644 --- a/keymap/emacs.js +++ b/keymap/emacs.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../lib/codemirror")); diff --git a/keymap/sublime.js b/keymap/sublime.js index 9158e27944..0681fa3e2b 100644 --- a/keymap/sublime.js +++ b/keymap/sublime.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // A rough approximation of Sublime Text's keybindings // Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js diff --git a/keymap/vim.js b/keymap/vim.js index e33d269089..9dce29e253 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Supported keybindings: * diff --git a/lib/codemirror.js b/lib/codemirror.js index 0bf6f2d8e8..50bccb38a9 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // This is CodeMirror (http://codemirror.net), a code editor // implemented in JavaScript on top of the browser's DOM. // diff --git a/mode/apl/apl.js b/mode/apl/apl.js index 2ba74c18c2..0a318dad61 100644 --- a/mode/apl/apl.js +++ b/mode/apl/apl.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/asterisk/asterisk.js b/mode/asterisk/asterisk.js index c56fc0b38a..f34471d4eb 100644 --- a/mode/asterisk/asterisk.js +++ b/mode/asterisk/asterisk.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* * ===================================================================================== * diff --git a/mode/clike/clike.js b/mode/clike/clike.js index 60b88bf1aa..a114344f87 100644 --- a/mode/clike/clike.js +++ b/mode/clike/clike.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/clojure/clojure.js b/mode/clojure/clojure.js index 3b596ad607..f8e8879d42 100644 --- a/mode/clojure/clojure.js +++ b/mode/clojure/clojure.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Author: Hans Engel * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) diff --git a/mode/cobol/cobol.js b/mode/cobol/cobol.js index e66e42a191..231218509a 100644 --- a/mode/cobol/cobol.js +++ b/mode/cobol/cobol.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Author: Gautam Mehta * Branched from CodeMirror's Scheme mode diff --git a/mode/coffeescript/coffeescript.js b/mode/coffeescript/coffeescript.js index c6da8f2a29..5350f6099c 100644 --- a/mode/coffeescript/coffeescript.js +++ b/mode/coffeescript/coffeescript.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Link to the project's GitHub page: * https://github.com/pickhardt/coffeescript-codemirror-mode diff --git a/mode/commonlisp/commonlisp.js b/mode/commonlisp/commonlisp.js index a0f0732bf6..ffb3c96493 100644 --- a/mode/commonlisp/commonlisp.js +++ b/mode/commonlisp/commonlisp.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/css/css.js b/mode/css/css.js index 8828329fc4..6b49e473f0 100644 --- a/mode/css/css.js +++ b/mode/css/css.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/css/less_test.js b/mode/css/less_test.js index ea64f91d12..a569e107dd 100644 --- a/mode/css/less_test.js +++ b/mode/css/less_test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { "use strict"; diff --git a/mode/css/scss_test.js b/mode/css/scss_test.js index c51cb42bba..85077532dc 100644 --- a/mode/css/scss_test.js +++ b/mode/css/scss_test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } diff --git a/mode/css/test.js b/mode/css/test.js index f9f667295c..85f597b570 100644 --- a/mode/css/test.js +++ b/mode/css/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({indentUnit: 2}, "css"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/cypher/cypher.js b/mode/cypher/cypher.js index f102c9ec1a..902430c2b0 100644 --- a/mode/cypher/cypher.js +++ b/mode/cypher/cypher.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // By the Neo4j Team and contributors. // https://github.com/neo4j-contrib/CodeMirror diff --git a/mode/d/d.js b/mode/d/d.js index 3ab8b42838..cb9a674cec 100644 --- a/mode/d/d.js +++ b/mode/d/d.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/diff/diff.js b/mode/diff/diff.js index d43f15d51a..ad62f2fcef 100644 --- a/mode/diff/diff.js +++ b/mode/diff/diff.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/django/django.js b/mode/django/django.js index 38de7d5ee3..3fe57cdea3 100644 --- a/mode/django/django.js +++ b/mode/django/django.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), diff --git a/mode/dtd/dtd.js b/mode/dtd/dtd.js index b4a6cb3155..7c3b6a1cab 100644 --- a/mode/dtd/dtd.js +++ b/mode/dtd/dtd.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* DTD mode Ported to CodeMirror by Peter Kroon diff --git a/mode/dylan/dylan.js b/mode/dylan/dylan.js index ccf9679181..b4526f6fad 100644 --- a/mode/dylan/dylan.js +++ b/mode/dylan/dylan.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/ecl/ecl.js b/mode/ecl/ecl.js index 2b841ff5f1..18d60899e0 100644 --- a/mode/ecl/ecl.js +++ b/mode/ecl/ecl.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/eiffel/eiffel.js b/mode/eiffel/eiffel.js index c6c3c84600..52c54e7863 100644 --- a/mode/eiffel/eiffel.js +++ b/mode/eiffel/eiffel.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/erlang/erlang.js b/mode/erlang/erlang.js index 3d4b1ba92e..7e2a1d4ad3 100644 --- a/mode/erlang/erlang.js +++ b/mode/erlang/erlang.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /*jshint unused:true, eqnull:true, curly:true, bitwise:true */ /*jshint undef:true, latedef:true, trailing:true */ /*global CodeMirror:true */ diff --git a/mode/fortran/fortran.js b/mode/fortran/fortran.js index 58dac127c1..66b9c9ad70 100644 --- a/mode/fortran/fortran.js +++ b/mode/fortran/fortran.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/gas/gas.js b/mode/gas/gas.js index ba5f195a11..6bf66b6f49 100644 --- a/mode/gas/gas.js +++ b/mode/gas/gas.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/gfm/gfm.js b/mode/gfm/gfm.js index 5a028c48b4..5de044807d 100644 --- a/mode/gfm/gfm.js +++ b/mode/gfm/gfm.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay")); diff --git a/mode/gfm/test.js b/mode/gfm/test.js index d06a219240..f3d72bfadf 100644 --- a/mode/gfm/test.js +++ b/mode/gfm/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({tabSize: 4}, "gfm"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/gherkin/gherkin.js b/mode/gherkin/gherkin.js index 41003641ec..c94efcb6aa 100644 --- a/mode/gherkin/gherkin.js +++ b/mode/gherkin/gherkin.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* Gherkin mode - http://www.cukes.info/ Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues diff --git a/mode/go/go.js b/mode/go/go.js index 82463052f6..46e13b6c54 100644 --- a/mode/go/go.js +++ b/mode/go/go.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/groovy/groovy.js b/mode/groovy/groovy.js index 399452d536..4a867d8337 100644 --- a/mode/groovy/groovy.js +++ b/mode/groovy/groovy.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/haml/haml.js b/mode/haml/haml.js index 59a86e7cec..1ab5001fc2 100644 --- a/mode/haml/haml.js +++ b/mode/haml/haml.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); diff --git a/mode/haml/test.js b/mode/haml/test.js index 75d0e7710f..0a8fc55696 100644 --- a/mode/haml/test.js +++ b/mode/haml/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/haskell/haskell.js b/mode/haskell/haskell.js index 2876172a95..4d923568d0 100644 --- a/mode/haskell/haskell.js +++ b/mode/haskell/haskell.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/haxe/haxe.js b/mode/haxe/haxe.js index ffde5991ad..487a88ddf3 100644 --- a/mode/haxe/haxe.js +++ b/mode/haxe/haxe.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/htmlembedded/htmlembedded.js b/mode/htmlembedded/htmlembedded.js index 3a07c3432e..7b3b9be725 100644 --- a/mode/htmlembedded/htmlembedded.js +++ b/mode/htmlembedded/htmlembedded.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); diff --git a/mode/htmlmixed/htmlmixed.js b/mode/htmlmixed/htmlmixed.js index d80ef9c64c..1dacbe8098 100644 --- a/mode/htmlmixed/htmlmixed.js +++ b/mode/htmlmixed/htmlmixed.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); diff --git a/mode/http/http.js b/mode/http/http.js index d2ad5994b6..bd0cb574d3 100644 --- a/mode/http/http.js +++ b/mode/http/http.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/jade/jade.js b/mode/jade/jade.js index 64d4d2f4be..b7c99b083d 100644 --- a/mode/jade/jade.js +++ b/mode/jade/jade.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed")); diff --git a/mode/javascript/javascript.js b/mode/javascript/javascript.js index e719089349..71e8a09c6f 100644 --- a/mode/javascript/javascript.js +++ b/mode/javascript/javascript.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // TODO actually recognize syntax of TypeScript constructs (function(mod) { diff --git a/mode/javascript/test.js b/mode/javascript/test.js index 782f0457f9..4411a98452 100644 --- a/mode/javascript/test.js +++ b/mode/javascript/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/jinja2/jinja2.js b/mode/jinja2/jinja2.js index 4b535e5322..e80c772929 100644 --- a/mode/jinja2/jinja2.js +++ b/mode/jinja2/jinja2.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/julia/julia.js b/mode/julia/julia.js index d37ab503ed..79b47fb3ef 100644 --- a/mode/julia/julia.js +++ b/mode/julia/julia.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/livescript/livescript.js b/mode/livescript/livescript.js index 1efc3ecf66..8e822bd6d3 100644 --- a/mode/livescript/livescript.js +++ b/mode/livescript/livescript.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Link to the project's GitHub page: * https://github.com/duralog/CodeMirror diff --git a/mode/lua/lua.js b/mode/lua/lua.js index 3673557c27..6121b86b38 100644 --- a/mode/lua/lua.js +++ b/mode/lua/lua.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's // CodeMirror 1 mode. // highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting diff --git a/mode/markdown/markdown.js b/mode/markdown/markdown.js index 84ea4d46b9..81472f02f7 100644 --- a/mode/markdown/markdown.js +++ b/mode/markdown/markdown.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror", require("../xml/xml"))); diff --git a/mode/markdown/test.js b/mode/markdown/test.js index 4d1d70ad14..ba1b15fc82 100644 --- a/mode/markdown/test.js +++ b/mode/markdown/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/meta.js b/mode/meta.js index 5fc51ebeec..5cccf7e9ab 100644 --- a/mode/meta.js +++ b/mode/meta.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../lib/codemirror")); diff --git a/mode/mirc/mirc.js b/mode/mirc/mirc.js index 6b2a23a16c..321830baf7 100644 --- a/mode/mirc/mirc.js +++ b/mode/mirc/mirc.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + //mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara (function(mod) { diff --git a/mode/mllike/mllike.js b/mode/mllike/mllike.js index d4d59fceb7..18771467a8 100644 --- a/mode/mllike/mllike.js +++ b/mode/mllike/mllike.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/nginx/nginx.js b/mode/nginx/nginx.js index 4e17cdb3c4..22c266384d 100644 --- a/mode/nginx/nginx.js +++ b/mode/nginx/nginx.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/ntriples/ntriples.js b/mode/ntriples/ntriples.js index cd5eb24f07..1f9ba451cb 100644 --- a/mode/ntriples/ntriples.js +++ b/mode/ntriples/ntriples.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /********************************************************** * This script provides syntax highlighting support for * the Ntriples format. diff --git a/mode/octave/octave.js b/mode/octave/octave.js index 16fe4dfd78..e5a50bce3b 100644 --- a/mode/octave/octave.js +++ b/mode/octave/octave.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/pascal/pascal.js b/mode/pascal/pascal.js index 642dd9bf79..652addd2c2 100644 --- a/mode/pascal/pascal.js +++ b/mode/pascal/pascal.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/pegjs/pegjs.js b/mode/pegjs/pegjs.js index f74f2a4f22..725579d5a0 100644 --- a/mode/pegjs/pegjs.js +++ b/mode/pegjs/pegjs.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../javascript/javascript")); diff --git a/mode/perl/perl.js b/mode/perl/perl.js index 0126d3ea36..9b02783a1d 100644 --- a/mode/perl/perl.js +++ b/mode/perl/perl.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) // This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) diff --git a/mode/php/php.js b/mode/php/php.js index 81591e4d65..4185804791 100644 --- a/mode/php/php.js +++ b/mode/php/php.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike")); diff --git a/mode/php/test.js b/mode/php/test.js index db68d75de3..2d901cf08d 100644 --- a/mode/php/test.js +++ b/mode/php/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({indentUnit: 2}, "php"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/pig/pig.js b/mode/pig/pig.js index 64ac506a79..52ad349c41 100644 --- a/mode/pig/pig.js +++ b/mode/pig/pig.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* * Pig Latin Mode for CodeMirror 2 * @author Prasanth Jayachandran diff --git a/mode/properties/properties.js b/mode/properties/properties.js index 6dfe06f128..b91191a7b5 100644 --- a/mode/properties/properties.js +++ b/mode/properties/properties.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/puppet/puppet.js b/mode/puppet/puppet.js index da8823e5ed..bba431eb3d 100644 --- a/mode/puppet/puppet.js +++ b/mode/puppet/puppet.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/python/python.js b/mode/python/python.js index 4fc4354ff7..1fb32a7c16 100644 --- a/mode/python/python.js +++ b/mode/python/python.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/q/q.js b/mode/q/q.js index d6e3b66610..ff788d9d52 100644 --- a/mode/q/q.js +++ b/mode/q/q.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/r/r.js b/mode/r/r.js index 281d7fa40f..d04eca3899 100644 --- a/mode/r/r.js +++ b/mode/r/r.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/rpm/rpm.js b/mode/rpm/rpm.js index 497997c4ff..bad1b3e024 100644 --- a/mode/rpm/rpm.js +++ b/mode/rpm/rpm.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/rst/rst.js b/mode/rst/rst.js index 0763d4b999..11c3678428 100644 --- a/mode/rst/rst.js +++ b/mode/rst/rst.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror"), require("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay")); diff --git a/mode/ruby/ruby.js b/mode/ruby/ruby.js index 4ef08b1552..8ffd2d7e8a 100644 --- a/mode/ruby/ruby.js +++ b/mode/ruby/ruby.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/ruby/test.js b/mode/ruby/test.js index c97d106686..1a6067d027 100644 --- a/mode/ruby/test.js +++ b/mode/ruby/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/rust/rust.js b/mode/rust/rust.js index 2e6e20b231..e7abed3520 100644 --- a/mode/rust/rust.js +++ b/mode/rust/rust.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/sass/sass.js b/mode/sass/sass.js index 74ae91db12..8cdb1365f9 100644 --- a/mode/sass/sass.js +++ b/mode/sass/sass.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/scheme/scheme.js b/mode/scheme/scheme.js index 7124f7283b..97979057ef 100644 --- a/mode/scheme/scheme.js +++ b/mode/scheme/scheme.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Author: Koh Zi Han, based on implementation by Koh Zi Chun */ diff --git a/mode/shell/shell.js b/mode/shell/shell.js index 5abb44711f..c1893a4dd1 100644 --- a/mode/shell/shell.js +++ b/mode/shell/shell.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/shell/test.js b/mode/shell/test.js index 3ab045c087..8bdb82103d 100644 --- a/mode/shell/test.js +++ b/mode/shell/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({}, "shell"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/sieve/sieve.js b/mode/sieve/sieve.js index 8256dda0a4..d74c839e01 100644 --- a/mode/sieve/sieve.js +++ b/mode/sieve/sieve.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/smalltalk/smalltalk.js b/mode/smalltalk/smalltalk.js index deb78a4f7a..42fdc67830 100644 --- a/mode/smalltalk/smalltalk.js +++ b/mode/smalltalk/smalltalk.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/smarty/smarty.js b/mode/smarty/smarty.js index 2a78c6d394..8c4bd13b61 100644 --- a/mode/smarty/smarty.js +++ b/mode/smarty/smarty.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * Smarty 2 and 3 mode. */ diff --git a/mode/smartymixed/smartymixed.js b/mode/smartymixed/smartymixed.js index 7e5e12c0ec..3be014b872 100644 --- a/mode/smartymixed/smartymixed.js +++ b/mode/smartymixed/smartymixed.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /** * @file smartymixed.js * @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML) diff --git a/mode/solr/solr.js b/mode/solr/solr.js index 25d928ec1b..ed7eff6eb6 100644 --- a/mode/solr/solr.js +++ b/mode/solr/solr.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/sparql/sparql.js b/mode/sparql/sparql.js index f228b1dffe..f4453e6864 100644 --- a/mode/sparql/sparql.js +++ b/mode/sparql/sparql.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/sql/sql.js b/mode/sql/sql.js index 417db06282..59510ffa08 100644 --- a/mode/sql/sql.js +++ b/mode/sql/sql.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/stex/stex.js b/mode/stex/stex.js index 59a395a0fe..b5ef7898f3 100644 --- a/mode/stex/stex.js +++ b/mode/stex/stex.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) * Licence: MIT diff --git a/mode/stex/test.js b/mode/stex/test.js index ab629e81ea..6eaf0f6881 100644 --- a/mode/stex/test.js +++ b/mode/stex/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({tabSize: 4}, "stex"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/tcl/tcl.js b/mode/tcl/tcl.js index 4c29ee7d98..49c555b108 100644 --- a/mode/tcl/tcl.js +++ b/mode/tcl/tcl.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + //tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara (function(mod) { diff --git a/mode/tiddlywiki/tiddlywiki.js b/mode/tiddlywiki/tiddlywiki.js index ecd1d173c0..31dff8cb93 100644 --- a/mode/tiddlywiki/tiddlywiki.js +++ b/mode/tiddlywiki/tiddlywiki.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /*** |''Name''|tiddlywiki.js| |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| diff --git a/mode/tiki/tiki.js b/mode/tiki/tiki.js index eb9a893fde..02c2f1b74b 100644 --- a/mode/tiki/tiki.js +++ b/mode/tiki/tiki.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/toml/toml.js b/mode/toml/toml.js index 2c722b3752..593807a900 100644 --- a/mode/toml/toml.js +++ b/mode/toml/toml.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/turtle/turtle.js b/mode/turtle/turtle.js index de9fc2b6c7..b2c7023c16 100644 --- a/mode/turtle/turtle.js +++ b/mode/turtle/turtle.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/vb/vb.js b/mode/vb/vb.js index 4fd80210fb..6fa42d97eb 100644 --- a/mode/vb/vb.js +++ b/mode/vb/vb.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/vbscript/vbscript.js b/mode/vbscript/vbscript.js index 4be7c7f2bb..9293c0af34 100644 --- a/mode/vbscript/vbscript.js +++ b/mode/vbscript/vbscript.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + /* For extra ASP classic objects, initialize CodeMirror instance with this option: isASP: true diff --git a/mode/velocity/velocity.js b/mode/velocity/velocity.js index b64636bb43..fd0292920b 100644 --- a/mode/velocity/velocity.js +++ b/mode/velocity/velocity.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/verilog/test.js b/mode/verilog/test.js index 6f5770b848..42d4f618cf 100644 --- a/mode/verilog/test.js +++ b/mode/verilog/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({indentUnit: 4}, "verilog"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } diff --git a/mode/verilog/verilog.js b/mode/verilog/verilog.js index d52ecea2a3..c575ac5f51 100644 --- a/mode/verilog/verilog.js +++ b/mode/verilog/verilog.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/xml/test.js b/mode/xml/test.js index 1b9d9d1760..122e1675ce 100644 --- a/mode/xml/test.js +++ b/mode/xml/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function() { var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } diff --git a/mode/xml/xml.js b/mode/xml/xml.js index 3248c454d1..946757fc57 100644 --- a/mode/xml/xml.js +++ b/mode/xml/xml.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/xquery/test.js b/mode/xquery/test.js index 41719dd169..511a879d90 100644 --- a/mode/xquery/test.js +++ b/mode/xquery/test.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + // Don't take these too seriously -- the expected results appear to be // based on the results of actual runs without any serious manual // verification. If a change you made causes them to fail, the test is diff --git a/mode/xquery/xquery.js b/mode/xquery/xquery.js index 2c7faf425a..0426bf66a5 100644 --- a/mode/xquery/xquery.js +++ b/mode/xquery/xquery.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/yaml/yaml.js b/mode/yaml/yaml.js index f7b3a90c03..41679f1eea 100644 --- a/mode/yaml/yaml.js +++ b/mode/yaml/yaml.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/mode/z80/z80.js b/mode/z80/z80.js index c778803072..d441e383ac 100644 --- a/mode/z80/z80.js +++ b/mode/z80/z80.js @@ -1,3 +1,6 @@ +// CodeMirror 4.1.1, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); diff --git a/test/lint/lint.js b/test/lint/lint.js index a65deb60be..ba8900f7d7 100644 --- a/test/lint/lint.js +++ b/test/lint/lint.js @@ -31,6 +31,8 @@ var scopePasser = walk.make({ ScopeBody: function(node, prev, c) { c(node, node.scope); } }); +var cBlob = /^\/\/ CodeMirror \d+\.\d+\.\d+, copyright \(c\) by Marijn Haverbeke and others\n\/\/ Distributed under an MIT license: http:\/\/codemirror.net\/LICENSE\n\n/; + function checkFile(fileName) { var file = fs.readFileSync(fileName, "utf8"), notAllowed; if (notAllowed = file.match(/[\x00-\x08\x0b\x0c\x0e-\x19\uFEFF\t]|[ \t]\n/)) { @@ -41,6 +43,9 @@ function checkFile(fileName) { var info = acorn.getLineInfo(file, notAllowed.index); fail(msg + " at line " + info.line + ", column " + info.column, {source: fileName}); } + + if (!cBlob.test(file)) + fail("Missing license blob", {source: fileName}); var globalsSeen = Object.create(null); @@ -152,7 +157,7 @@ function checkDir(dir) { fs.readdirSync(dir).forEach(function(file) { var fname = dir + "/" + file; if (/\.js$/.test(file)) checkFile(fname); - else if (file != "dep" && fs.lstatSync(fname).isDirectory()) checkDir(fname); + else if (fs.lstatSync(fname).isDirectory()) checkDir(fname); }); } From 01fb28518dd76a7848606669020bc1b85a81c899 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 9 May 2014 15:56:59 +0200 Subject: [PATCH 72/96] Fix bug in release script --- bin/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/release b/bin/release index 91451faae5..c26d290f94 100755 --- a/bin/release +++ b/bin/release @@ -30,7 +30,7 @@ rewrite("doc/manual.html", function(manual) { function walkDir(dir) { fs.readdirSync(dir).forEach(function(file) { var fname = dir + "/" + file; - if (/\.js$/.test(file)) rewrite(file, function(script) { + if (/\.js$/.test(file)) rewrite(fname, function(script) { return script.replace(/^\/\/ CodeMirror \d+\.\d+\.\d+, copyright/, "// CodeMirror " + number + ", copyright"); }); From a5b79b5c30fd8694fcb1fdaafeb70ab0bd335ca9 Mon Sep 17 00:00:00 2001 From: as3boyan Date: Sat, 10 May 2014 22:00:23 +0300 Subject: [PATCH 73/96] [show-hint addon] Fix a typo --- addon/hint/show-hint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/hint/show-hint.js b/addon/hint/show-hint.js index 4bede1fb03..59322749ce 100644 --- a/addon/hint/show-hint.js +++ b/addon/hint/show-hint.js @@ -379,7 +379,7 @@ alignWithWord: true, closeCharacters: /[\s()\[\]{};:>,]/, closeOnUnfocus: true, - completeOnSignleClick: false, + completeOnSingleClick: false, container: null, customKeys: null, extraKeys: null From a0edb5ba6f5d6ccb289ab6ab2ef2b6b4ad98762b Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 12 May 2014 09:20:28 +0200 Subject: [PATCH 74/96] Don't mess up the display when updateDisplay is given a negative top offset Issue #2554 --- lib/codemirror.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index 50bccb38a9..ddb2514618 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -463,7 +463,7 @@ // the the current scroll position). viewPort may contain top, // height, and ensure (see op.scrollToPos) properties. function visibleLines(display, doc, viewPort) { - var top = viewPort && viewPort.top != null ? viewPort.top : display.scroller.scrollTop; + var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop; top = Math.floor(top - paddingTop(display)); var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight; @@ -667,7 +667,6 @@ cm.display.gutters.style.height = Math.max(measure.docHeight, measure.clientHeight - scrollerCutOff) + "px"; } - function checkForWebkitWidthBug(cm, measure) { // Work around Webkit bug where it sometimes reserves space for a // non-existing phantom scrollbar in the scroller (Issue #2420) From bb0725b52fd9a1bcf19c623e0fb19f43ace40522 Mon Sep 17 00:00:00 2001 From: Bem Jones-Bey Date: Fri, 9 May 2014 10:28:00 -0700 Subject: [PATCH 75/96] [css mode] Add object-fit and object-position properties --- mode/css/css.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mode/css/css.js b/mode/css/css.js index 6b49e473f0..e5ed6ad5f5 100644 --- a/mode/css/css.js +++ b/mode/css/css.js @@ -425,7 +425,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "marker-offset", "marks", "marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed", "marquee-style", "max-height", "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", - "nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline", + "nav-left", "nav-right", "nav-up", "object-fit", "object-position", + "opacity", "order", "orphans", "outline", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", From 33eb40146574312f7de39c697af3b18c86d0d902 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 12 May 2014 10:07:27 +0200 Subject: [PATCH 76/96] [css mode] Better handling of parentheses in property values Issue #2551 --- mode/css/css.js | 15 +++++---------- mode/css/test.js | 10 ++++++++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mode/css/css.js b/mode/css/css.js index e5ed6ad5f5..00d3785bcf 100644 --- a/mode/css/css.js +++ b/mode/css/css.js @@ -167,7 +167,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { } else if (type == ":") { return "pseudo"; } else if (allowNested && type == "(") { - return pushContext(state, stream, "params"); + return pushContext(state, stream, "parens"); } return state.context.type; }; @@ -228,6 +228,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { states.parens = function(type, stream, state) { if (type == "{" || type == "}") return popAndPass(type, stream, state); if (type == ")") return popContext(state); + if (type == "(") return pushContext(state, stream, "parens"); + if (type == "word") wordAsValue(stream); return "parens"; }; @@ -303,13 +305,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return "interpolation"; }; - states.params = function(type, stream, state) { - if (type == ")") return popContext(state); - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == "word") wordAsValue(stream); - return "params"; - }; - return { startState: function(base) { return {tokenize: null, @@ -332,10 +327,10 @@ CodeMirror.defineMode("css", function(config, parserConfig) { indent: function(state, textAfter) { var cx = state.context, ch = textAfter && textAfter.charAt(0); var indent = cx.indent; - if (cx.type == "prop" && ch == "}") cx = cx.prev; + if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; if (cx.prev && (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") || - ch == ")" && (cx.type == "parens" || cx.type == "params" || cx.type == "media_parens") || + ch == ")" && (cx.type == "parens" || cx.type == "media_parens") || ch == "{" && (cx.type == "at" || cx.type == "media"))) { indent = cx.indent - indentUnit; cx = cx.prev; diff --git a/mode/css/test.js b/mode/css/test.js index 85f597b570..1a75e08ea4 100644 --- a/mode/css/test.js +++ b/mode/css/test.js @@ -122,4 +122,14 @@ MT("empty_url", "[def @import] [tag url]() [tag screen];"); + + MT("parens", + "[qualifier .foo] {", + " [property background-image]: [variable fade]([atom #000], [number 20%]);", + " [property border-image]: [variable linear-gradient](", + " [atom to] [atom bottom],", + " [variable fade]([atom #000], [number 20%]) [number 0%],", + " [variable fade]([atom #000], [number 20%]) [number 100%]", + " );", + "}"); })(); From 687fb51f4a6547942b08efee81e8b84393d99a5b Mon Sep 17 00:00:00 2001 From: daines Date: Mon, 12 May 2014 09:24:07 -0400 Subject: [PATCH 77/96] Fix typo in manual --- doc/manual.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual.html b/doc/manual.html index 59c81f3456..d78797dadd 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -2328,7 +2328,7 @@

    Static properties

    of the token that is being completed as {line, ch} objects.
    If no hinting function is given, the addon will - use CodeMirror.hint.auto, with + use CodeMirror.hint.auto, which calls getHelpers with the "hint" type to find applicable hinting functions, and tries them one by one. If that fails, it looks From 87df1c6e7f2a07c42689c6afba4b7192445196c8 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 13 May 2014 11:20:30 +0200 Subject: [PATCH 78/96] [closetag addon] Improve heuristic for seeing if closing tag already exists Issue #2557 --- addon/edit/closetag.js | 28 +++++++++++++++++++++++++--- addon/fold/xml-fold.js | 2 +- mode/xml/xml.js | 2 +- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/addon/edit/closetag.js b/addon/edit/closetag.js index d64045ab1b..db31b0eb02 100644 --- a/addon/edit/closetag.js +++ b/addon/edit/closetag.js @@ -58,6 +58,7 @@ var pos = ranges[i].head, tok = cm.getTokenAt(pos); var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass; + var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); @@ -71,8 +72,7 @@ tok.type == "tag" && state.type == "closeTag" || tok.string.indexOf("/") == (tok.string.length - 1) || // match something like dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 || - CodeMirror.scanForClosingTag && CodeMirror.scanForClosingTag(cm, pos, tagName, - Math.min(cm.lastLine() + 1, pos.line + 50))) + closingTagExists(cm, tagName, pos, state, true)) return CodeMirror.Pass; var indent = indentTags && indexOf(indentTags, lowerTagName) > -1; @@ -103,7 +103,8 @@ var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; if (tok.type == "string" || tok.string.charAt(0) != "<" || tok.start != pos.ch - 1 || inner.mode.name != "xml" || - !state.context || !state.context.tagName) + !state.context || !state.context.tagName || + closingTagExists(cm, state.context.tagName, pos, state)) return CodeMirror.Pass; replacements[i] = "/" + state.context.tagName + ">"; } @@ -116,4 +117,25 @@ if (collection[i] == elt) return i; return -1; } + + // If xml-fold is loaded, we use its functionality to try and verify + // whether a given tag is actually unclosed. + function closingTagExists(cm, tagName, pos, state, newTag) { + if (!CodeMirror.scanForClosingTag) return false; + var end = Math.min(cm.lastLine() + 1, pos.line + 500); + var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end); + if (!nextClose || nextClose.tag != tagName) return false; + var cx = state.context; + // If the immediate wrapping context contains onCx instances of + // the same tag, a closing tag only exists if there are at least + // that many closing tags of that type following. + for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx; + pos = nextClose.to; + for (var i = 1; i < onCx; i++) { + var next = CodeMirror.scanForClosingTag(cm, pos, null, end); + if (!next || next.tag != tagName) return false; + pos = next.to; + } + return true; + } }); diff --git a/addon/fold/xml-fold.js b/addon/fold/xml-fold.js index e1fd5756d8..33d6e07b53 100644 --- a/addon/fold/xml-fold.js +++ b/addon/fold/xml-fold.js @@ -176,6 +176,6 @@ // Used by addon/edit/closetag.js CodeMirror.scanForClosingTag = function(cm, pos, name, end) { var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null); - return !!findMatchingClose(iter, name); + return findMatchingClose(iter, name); }; }); diff --git a/mode/xml/xml.js b/mode/xml/xml.js index 946757fc57..9a84b632aa 100644 --- a/mode/xml/xml.js +++ b/mode/xml/xml.js @@ -124,7 +124,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { state.state = baseState; state.tagName = state.tagStart = null; var next = state.tokenize(stream, state); - return next ? next + " error" : "error"; + return next ? next + " tag error" : "tag error"; } else if (/[\'\"]/.test(ch)) { state.tokenize = inAttribute(ch); state.stringStartCol = stream.column(); From 5b5c813680f3f69affc472942e3000c1b714e0db Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 13 May 2014 11:32:21 +0200 Subject: [PATCH 79/96] Make ctrl-drag copy text Issue #2556 --- lib/codemirror.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index ddb2514618..ba39b4e9a3 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -2574,17 +2574,17 @@ lastClick = {time: now, pos: start}; } - var sel = cm.doc.sel, addNew = mac ? e.metaKey : e.ctrlKey; - if (cm.options.dragDrop && dragAndDrop && !addNew && !isReadOnly(cm) && + var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && type == "single" && sel.contains(start) > -1 && sel.somethingSelected()) - leftButtonStartDrag(cm, e, start); + leftButtonStartDrag(cm, e, start, modifier); else - leftButtonSelect(cm, e, start, type, addNew); + leftButtonSelect(cm, e, start, type, modifier); } // Start a text drag. When it ends, see if any dragging actually // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, e, start) { + function leftButtonStartDrag(cm, e, start, modifier) { var display = cm.display; var dragEnd = operation(cm, function(e2) { if (webkit) display.scroller.draggable = false; @@ -2593,7 +2593,8 @@ off(display.scroller, "drop", dragEnd); if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { e_preventDefault(e2); - extendSelection(cm.doc, start); + if (!modifier) + extendSelection(cm.doc, start); focusInput(cm); // Work around unexplainable focus problem in IE9 (#2127) if (ie_upto10 && !ie_upto8) @@ -2817,7 +2818,8 @@ try { var text = e.dataTransfer.getData("Text"); if (text) { - var selected = cm.state.draggingText && cm.listSelections(); + if (cm.state.draggingText && !(mac ? e.metaKey : e.ctrlKey)) + var selected = cm.listSelections(); setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); if (selected) for (var i = 0; i < selected.length; ++i) replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); From e6eed2510342b43bdc869f860385a49f8e4061a0 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 13 May 2014 11:53:02 +0200 Subject: [PATCH 80/96] Ensure a viewport always contains a single line --- lib/codemirror.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index ba39b4e9a3..371c37651f 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -479,7 +479,7 @@ return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight), to: ensureTo}; } - return {from: from, to: to}; + return {from: from, to: Math.max(to, from + 1)}; } // LINE NUMBERS From 02725ae5464565178884059639e791ca42aee266 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 13 May 2014 13:18:48 +0200 Subject: [PATCH 81/96] [tern addon] Improve alignment of completion docs --- addon/tern/tern.css | 1 + 1 file changed, 1 insertion(+) diff --git a/addon/tern/tern.css b/addon/tern/tern.css index eacc2f053a..76fba33d4a 100644 --- a/addon/tern/tern.css +++ b/addon/tern/tern.css @@ -76,6 +76,7 @@ .CodeMirror-Tern-hint-doc { max-width: 25em; + margin-top: -3px; } .CodeMirror-Tern-fname { color: black; } From 9556bdd640d17ffccaa40d80939cfbce0e36b160 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 13 May 2014 13:34:43 +0200 Subject: [PATCH 82/96] [tern addon] Remove unnecessary error check --- addon/tern/tern.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addon/tern/tern.js b/addon/tern/tern.js index 318f1484d9..3508f18130 100644 --- a/addon/tern/tern.js +++ b/addon/tern/tern.js @@ -432,7 +432,7 @@ function rename(ts, cm) { var token = cm.getTokenAt(cm.getCursor()); - if (!/\w/.test(token.string)) showError(ts, cm, "Not at a variable"); + if (!/\w/.test(token.string)) return showError(ts, cm, "Not at a variable"); dialog(cm, "New name for " + token.string, function(newName) { ts.request(cm, {type: "rename", newName: newName, fullDocs: true}, function(error, data) { if (error) return showError(ts, cm, error); @@ -443,7 +443,6 @@ function selectName(ts, cm) { var cur = cm.getCursor(), token = cm.getTokenAt(cur); - if (!/\w/.test(token.string)) showError(ts, cm, "Not at a variable"); var name = findDoc(ts, cm.doc).name; ts.request(cm, {type: "refs"}, function(error, data) { if (error) return showError(ts, cm, error); From 09c8a0b09afe6eab99ea297a2d2bc1c737546b80 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 13 May 2014 13:41:49 +0200 Subject: [PATCH 83/96] [tern addon] Lint fix --- addon/tern/tern.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addon/tern/tern.js b/addon/tern/tern.js index 3508f18130..9bae94b27e 100644 --- a/addon/tern/tern.js +++ b/addon/tern/tern.js @@ -442,7 +442,6 @@ } function selectName(ts, cm) { - var cur = cm.getCursor(), token = cm.getTokenAt(cur); var name = findDoc(ts, cm.doc).name; ts.request(cm, {type: "refs"}, function(error, data) { if (error) return showError(ts, cm, error); From 714954d744e74626b38a87834c7e46a589133f01 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 15 May 2014 12:34:58 +0200 Subject: [PATCH 84/96] [tern addon] Allow hiding and deleting docs by identity, not just name --- addon/tern/tern.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/addon/tern/tern.js b/addon/tern/tern.js index 9bae94b27e..27d6421512 100644 --- a/addon/tern/tern.js +++ b/addon/tern/tern.js @@ -17,7 +17,7 @@ // indicate that a file is not available. // * fileFilter: A function(value, docName, doc) that will be applied // to documents before passing them on to Tern. -// * switchToDoc: A function(name) that should, when providing a +// * switchToDoc: A function(name, doc) that should, when providing a // multi-file view, switch the view or focus to the named file. // * showError: A function(editor, message) that can be used to // override the way errors are displayed. @@ -88,17 +88,17 @@ return this.docs[name] = data; }, - delDoc: function(name) { - var found = this.docs[name]; + delDoc: function(id) { + var found = resolveDoc(this, id); if (!found) return; CodeMirror.off(found.doc, "change", this.trackChange); - delete this.docs[name]; - this.server.delFile(name); + delete this.docs[found.name]; + this.server.delFile(found.name); }, - hideDoc: function(name) { + hideDoc: function(id) { closeArgHints(this); - var found = this.docs[name]; + var found = resolveDoc(this, id); if (found && found.changed) sendDoc(this, found); }, @@ -157,6 +157,12 @@ return ts.addDoc(name, doc); } + function resolveDoc(ts, id) { + if (typeof id == "string") return ts.docs[id]; + if (id instanceof CodeMirror) id = id.getDoc(); + if (id instanceof CodeMirror.Doc) return findDoc(ts, id); + } + function trackChange(ts, doc, change) { var data = findDoc(ts, doc); @@ -387,7 +393,7 @@ doc.doc.setSelection(end, start); if (curDoc != doc && ts.options.switchToDoc) { closeArgHints(ts); - ts.options.switchToDoc(doc.name); + ts.options.switchToDoc(doc.name, doc.doc); } } From c6e7cd1bd76cb42fe67199cd643d2b17cc3d0372 Mon Sep 17 00:00:00 2001 From: Yunchi Luo Date: Fri, 9 May 2014 20:42:08 +0200 Subject: [PATCH 85/96] [vim] Add vim keypress and command done events --- demo/vim.html | 11 +++++++++++ keymap/vim.js | 16 +++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/demo/vim.html b/demo/vim.html index ad34660892..f92ff9e6d8 100644 --- a/demo/vim.html +++ b/demo/vim.html @@ -45,6 +45,7 @@ return (--n >= 0) ? (unsigned char) *bufp++ : EOF; } +