Showing with 3,317 additions and 1,351 deletions.
  1. +2 −0 .gitignore
  2. +14 −0 AUTHORS
  3. +2 −2 CONTRIBUTING.md
  4. +2 −2 README.md
  5. +1 −1 addon/comment/comment.js
  6. +4 −1 addon/dialog/dialog.js
  7. +7 −6 addon/edit/closebrackets.js
  8. +21 −8 addon/edit/continuelist.js
  9. +54 −20 addon/hint/sql-hint.js
  10. +10 −15 addon/lint/lint.js
  11. +210 −0 addon/mode/simple.js
  12. +5 −1 addon/runmode/runmode-standalone.js
  13. +2 −4 addon/runmode/runmode.node.js
  14. +1 −1 bower.json
  15. +2 −2 demo/activeline.html
  16. +2 −2 demo/anywordhint.html
  17. +3 −3 demo/bidi.html
  18. +2 −2 demo/btree.html
  19. +2 −2 demo/buffers.html
  20. +2 −2 demo/changemode.html
  21. +3 −3 demo/closebrackets.html
  22. +2 −2 demo/closetag.html
  23. +2 −2 demo/complete.html
  24. +2 −2 demo/emacs.html
  25. +2 −2 demo/folding.html
  26. +2 −2 demo/fullscreen.html
  27. +2 −2 demo/hardwrap.html
  28. +2 −2 demo/html5complete.html
  29. +2 −2 demo/indentwrap.html
  30. +2 −2 demo/lint.html
  31. +28 −5 demo/loadmode.html
  32. +2 −2 demo/marker.html
  33. +2 −2 demo/markselection.html
  34. +2 −2 demo/matchhighlighter.html
  35. +2 −2 demo/matchtags.html
  36. +2 −2 demo/merge.html
  37. +2 −2 demo/multiplex.html
  38. +2 −2 demo/mustache.html
  39. +2 −2 demo/placeholder.html
  40. +2 −2 demo/preview.html
  41. +2 −2 demo/requirejs.html
  42. +2 −2 demo/resize.html
  43. +2 −2 demo/rulers.html
  44. +2 −2 demo/runmode.html
  45. +2 −2 demo/search.html
  46. +181 −0 demo/simplemode.html
  47. +2 −2 demo/spanaffectswrapping_shim.html
  48. +2 −2 demo/sublime.html
  49. +2 −2 demo/tern.html
  50. +2 −2 demo/theme.html
  51. +2 −2 demo/trailingspace.html
  52. +2 −2 demo/variableheight.html
  53. +2 −2 demo/vim.html
  54. +2 −2 demo/visibletabs.html
  55. +2 −2 demo/widget.html
  56. +2 −2 demo/xmlcomplete.html
  57. +6 −2 doc/compress.html
  58. +11 −2 doc/docs.css
  59. +2 −2 doc/internals.html
  60. BIN doc/logo.png
  61. +157 −123 doc/logo.svg
  62. +36 −8 doc/manual.html
  63. +4 −3 doc/realworld.html
  64. +65 −34 doc/releases.html
  65. +2 −2 doc/reporting.html
  66. +2 −2 doc/upgrade_v2.2.html
  67. +2 −2 doc/upgrade_v3.html
  68. +2 −2 doc/upgrade_v4.html
  69. +6 −6 index.html
  70. +425 −554 keymap/vim.js
  71. +1 −1 lib/codemirror.css
  72. +24 −25 lib/codemirror.js
  73. +2 −2 mode/apl/index.html
  74. +2 −2 mode/asterisk/index.html
  75. +28 −5 mode/clike/clike.js
  76. +26 −5 mode/clike/index.html
  77. +2 −2 mode/clike/scala.html
  78. +5 −3 mode/clojure/clojure.js
  79. +2 −2 mode/clojure/index.html
  80. +2 −2 mode/cobol/index.html
  81. +8 −7 mode/coffeescript/coffeescript.js
  82. +2 −2 mode/coffeescript/index.html
  83. +2 −2 mode/commonlisp/index.html
  84. +2 −2 mode/css/index.html
  85. +2 −2 mode/css/less.html
  86. +2 −2 mode/css/scss.html
  87. +2 −2 mode/cypher/index.html
  88. +1 −1 mode/d/d.js
  89. +2 −2 mode/d/index.html
  90. +2 −2 mode/diff/index.html
  91. +2 −2 mode/django/index.html
  92. +1 −1 mode/dtd/dtd.js
  93. +2 −2 mode/dtd/index.html
  94. +2 −2 mode/dylan/index.html
  95. +2 −2 mode/ecl/index.html
  96. +2 −2 mode/eiffel/index.html
  97. +2 −2 mode/erlang/index.html
  98. +2 −2 mode/fortran/index.html
  99. +2 −2 mode/gas/index.html
  100. +2 −2 mode/gfm/index.html
  101. +11 −0 mode/gfm/test.js
  102. +1 −1 mode/gherkin/gherkin.js
  103. +2 −2 mode/gherkin/index.html
  104. +1 −1 mode/go/go.js
  105. +2 −2 mode/go/index.html
  106. +2 −2 mode/groovy/index.html
  107. +2 −2 mode/haml/index.html
  108. +1 −1 mode/haskell/haskell.js
  109. +2 −2 mode/haskell/index.html
  110. +2 −2 mode/haxe/index.html
  111. +2 −2 mode/htmlembedded/index.html
  112. +2 −2 mode/htmlmixed/index.html
  113. +2 −2 mode/http/index.html
  114. +4 −2 mode/index.html
  115. +2 −2 mode/jade/index.html
  116. +2 −2 mode/javascript/index.html
  117. +3 −3 mode/javascript/javascript.js
  118. +2 −2 mode/javascript/json-ld.html
  119. +7 −0 mode/javascript/test.js
  120. +2 −2 mode/javascript/typescript.html
  121. +2 −2 mode/jinja2/index.html
  122. +11 −2 mode/julia/index.html
  123. +1 −1 mode/julia/julia.js
  124. +2 −2 mode/kotlin/index.html
  125. +2 −2 mode/livescript/index.html
  126. +2 −2 mode/lua/index.html
  127. +2 −2 mode/markdown/index.html
  128. +4 −3 mode/markdown/markdown.js
  129. +129 −101 mode/meta.js
  130. +2 −2 mode/mirc/index.html
  131. +2 −2 mode/mllike/index.html
  132. +2 −2 mode/modelica/index.html
  133. +2 −2 mode/nginx/index.html
  134. +2 −2 mode/ntriples/index.html
  135. +2 −2 mode/octave/index.html
  136. +1 −1 mode/octave/octave.js
  137. +2 −2 mode/pascal/index.html
  138. +2 −2 mode/pegjs/index.html
  139. +2 −2 mode/perl/index.html
  140. +2 −2 mode/perl/perl.js
  141. +2 −2 mode/php/index.html
  142. +37 −44 mode/php/php.js
  143. +6 −0 mode/php/test.js
  144. +2 −2 mode/pig/index.html
  145. +2 −2 mode/properties/index.html
  146. +2 −2 mode/puppet/index.html
  147. +18 −6 mode/python/index.html
  148. +17 −4 mode/python/python.js
  149. +2 −2 mode/q/index.html
  150. +2 −2 mode/r/index.html
  151. +2 −2 mode/rpm/changes/index.html
  152. +2 −2 mode/rpm/index.html
  153. +2 −2 mode/rst/index.html
  154. +2 −2 mode/ruby/index.html
  155. +12 −11 mode/ruby/ruby.js
  156. +2 −2 mode/rust/index.html
  157. +2 −2 mode/rust/rust.js
  158. +2 −2 mode/sass/index.html
  159. +2 −2 mode/scheme/index.html
  160. +2 −2 mode/shell/index.html
  161. +2 −2 mode/sieve/index.html
  162. +2 −2 mode/slim/index.html
  163. +2 −2 mode/smalltalk/index.html
  164. +2 −2 mode/smarty/index.html
  165. +2 −2 mode/smartymixed/index.html
  166. +5 −1 mode/smartymixed/smartymixed.js
  167. +2 −2 mode/solr/index.html
  168. +2 −2 mode/sparql/index.html
  169. +2 −2 mode/sql/index.html
  170. +2 −1 mode/sql/sql.js
  171. +2 −2 mode/stex/index.html
  172. +2 −1 mode/stex/stex.js
  173. +2 −2 mode/tcl/index.html
  174. +1 −1 mode/tcl/tcl.js
  175. +191 −0 mode/textile/index.html
  176. +406 −0 mode/textile/test.js
  177. +553 −0 mode/textile/textile.js
  178. +2 −2 mode/tiddlywiki/index.html
  179. +2 −2 mode/tiki/index.html
  180. +2 −2 mode/toml/index.html
  181. +63 −0 mode/tornado/index.html
  182. +68 −0 mode/tornado/tornado.js
  183. +2 −2 mode/turtle/index.html
  184. +2 −2 mode/vb/index.html
  185. +2 −2 mode/vbscript/index.html
  186. +2 −2 mode/velocity/index.html
  187. +2 −2 mode/verilog/index.html
  188. +36 −2 mode/verilog/test.js
  189. +14 −9 mode/verilog/verilog.js
  190. +2 −2 mode/xml/index.html
  191. +2 −2 mode/xquery/index.html
  192. +2 −2 mode/yaml/index.html
  193. +2 −2 mode/z80/index.html
  194. +3 −3 package.json
  195. +4 −2 test/index.html
  196. +88 −35 test/vim_test.js
  197. +2 −2 theme/base16-dark.css
  198. +1 −1 theme/mdn-like.css
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ test.html
.tern-*
*~
*.swp
.idea
*.iml
14 changes: 14 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ List of CodeMirror contributors. Updated before every release.

4r2r
Aaron Brooks
Abdelouahab
Abe Fettig
Adam Ahmed
Adam King
Expand Down Expand Up @@ -61,6 +62,7 @@ Billy Moon
binny
B Krishna Chaitanya
Blaine G
blukat29
boomyjee
borawjm
Brandon Frohs
Expand All @@ -76,6 +78,7 @@ Chris Coyier
Chris Granger
Chris Houseknecht
Chris Morgan
Christian Oyarzun
Christopher Brown
ciaranj
CodeAnimal
Expand All @@ -99,6 +102,7 @@ David Pathakjee
deebugger
Deep Thought
dignifiedquire
Dimage Sapelkin
domagoj412
Dominator008
Domizio Demichelis
Expand Down Expand Up @@ -147,6 +151,7 @@ Hakan Tunc
Hans Engel
Hardest
Hasan Karahan
Herculano Campos
Hiroyuki Makino
hitsthings
Hocdoc
Expand Down Expand Up @@ -190,6 +195,7 @@ John Van Der Loo
Jonathan Malmaud
jongalloway
Jon Malmaud
Jon Sangster
Joost-Wim Boekesteijn
Joseph Pecoraro
Joshua Newman
Expand All @@ -199,6 +205,7 @@ jsoojeon
Juan Benavides Romero
Jucovschi Constantin
Juho Vuori
Justin Hileman
jwallers@gmail.com
kaniga
Ken Newman
Expand All @@ -215,6 +222,7 @@ Lanny
Laszlo Vidacs
leaf corcoran
Leonid Khachaturov
Leon Sorokin
Leonya Khachaturov
Liam Newman
LM
Expand All @@ -232,6 +240,7 @@ Marco Aurélio
Marco Munizaga
Marcus Bointon
Marijn Haverbeke
Mário Gonçalves
Mario Pietsch
Mark Lentczner
Marko Bonaci
Expand All @@ -243,6 +252,7 @@ Mateusz Paprocki
Mathias Bynens
mats cronqvist
Matthew Beale
Matthias Bussonnier
Matthias BUSSONNIER
Matt McDonald
Matt Pass
Expand All @@ -251,6 +261,7 @@ mauricio
Maximilian Hils
Maxim Kraev
Max Kirsch
Max Xiantu
mbarkhau
Metatheos
Micah Dubinko
Expand Down Expand Up @@ -283,7 +294,9 @@ Nikita Beloglazov
Nikita Vasilyev
Nikolay Kostov
nilp0inter
Nisarg Jhaveri
nlwillia
Norman Rzepka
pablo
Page
Panupong Pasupat
Expand Down Expand Up @@ -371,6 +384,7 @@ wenli
Wesley Wiser
William Jamieson
William Stein
Willy
Wojtek Ptak
Xavier Mendez
YNH Webdev
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Community discussion, questions, and informal bug reporting is done on the
## Submitting bug reports

The preferred way to report bugs is to use the
[GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before
[GitHub issue tracker](http://github.com/codemirror/CodeMirror/issues). Before
reporting a bug, read these pointers.

**Note:** The issue tracker is for *bugs*, not requests for help. Questions
Expand Down Expand Up @@ -48,7 +48,7 @@ should be asked on the
## Contributing code

- Make sure you have a [GitHub Account](https://github.com/signup/free)
- Fork [CodeMirror](https://github.com/marijnh/CodeMirror/)
- Fork [CodeMirror](https://github.com/codemirror/CodeMirror/)
([how to fork a repo](https://help.github.com/articles/fork-a-repo))
- Make your changes
- If your changes are easy to test or likely to regress, add tests.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CodeMirror
[![Build Status](https://travis-ci.org/marijnh/CodeMirror.svg)](https://travis-ci.org/marijnh/CodeMirror)
[![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror)
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)

CodeMirror is a JavaScript component that provides a code editor in
Expand All @@ -8,4 +8,4 @@ in, it will color your code, and optionally help with indentation.

The project page is http://codemirror.net
The manual is at http://codemirror.net/doc/manual.html
The contributing guidelines are in [CONTRIBUTING.md](https://github.com/marijnh/CodeMirror/blob/master/CONTRIBUTING.md)
The contributing guidelines are in [CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)
2 changes: 1 addition & 1 deletion addon/comment/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
CodeMirror.defineExtension("uncomment", function(from, to, options) {
if (!options) options = noOptions;
var self = this, mode = self.getModeAt(from);
var end = Math.min(to.line, self.lastLine()), start = Math.min(from.line, end);
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);

// Try finding line comments
var lineString = options.lineComment || mode.lineComment, lines = [];
Expand Down
5 changes: 4 additions & 1 deletion addon/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@

var inp = dialog.getElementsByTagName("input")[0], button;
if (inp) {
if (options.value) inp.value = options.value;
if (options.value) {
inp.value = options.value;
inp.select();
}

if (options.onInput)
CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
Expand Down
13 changes: 7 additions & 6 deletions addon/edit/closebrackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,25 @@
for (var i = 0; i < ranges.length; i++) {
var range = ranges[i], cur = range.head, curType;
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
if (!range.empty())
if (!range.empty()) {
curType = "surround";
else if (left == right && next == right) {
} else if (left == right && next == right) {
if (cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == left + left + left)
curType = "skipThree";
else
curType = "skip";
} else if (left == right && cur.ch > 1 &&
cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left &&
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left))
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) {
curType = "addFour";
else if (left == '"' || left == "'") {
} else if (left == '"' || left == "'") {
if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, left)) curType = "both";
else return CodeMirror.Pass;
} else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next))
} else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next)) {
curType = "both";
else
} else {
return CodeMirror.Pass;
}
if (!type) type = curType;
else if (type != curType) return CodeMirror.Pass;
}
Expand Down
29 changes: 21 additions & 8 deletions addon/edit/continuelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,39 @@
})(function(CodeMirror) {
"use strict";

var listRE = /^(\s*)([*+-]|(\d+)\.)(\s+)/,
var listRE = /^(\s*)([> ]+|[*+-]|(\d+)\.)(\s+)/,
emptyListRE = /^(\s*)([> ]+|[*+-]|(\d+)\.)(\s*)$/,
unorderedBullets = "*+-";

CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
if (cm.getOption("disableInput")) return CodeMirror.Pass;
var ranges = cm.listSelections(), replacements = [];
for (var i = 0; i < ranges.length; i++) {
var pos = ranges[i].head, match;
var inList = cm.getStateAfter(pos.line).list !== false;
var eolState = cm.getStateAfter(pos.line);
var inList = eolState.list !== false;
var inQuote = eolState.quote !== false;

if (!ranges[i].empty() || !inList || !(match = cm.getLine(pos.line).match(listRE))) {
if (!ranges[i].empty() || (!inList && !inQuote) || !(match = cm.getLine(pos.line).match(listRE))) {
cm.execCommand("newlineAndIndent");
return;
}
var indent = match[1], after = match[4];
var bullet = unorderedBullets.indexOf(match[2]) >= 0
? match[2]
: (parseInt(match[3], 10) + 1) + ".";
if (cm.getLine(pos.line).match(emptyListRE)) {
cm.replaceRange("", {
line: pos.line, ch: 0
}, {
line: pos.line, ch: pos.ch + 1
});
replacements[i] = "\n";

replacements[i] = "\n" + indent + bullet + after;
} else {
var indent = match[1], after = match[4];
var bullet = unorderedBullets.indexOf(match[2]) >= 0 || match[2].indexOf(">") >= 0
? match[2]
: (parseInt(match[3], 10) + 1) + ".";

replacements[i] = "\n" + indent + bullet + after;
}
}

cm.replaceSelections(replacements);
Expand Down
74 changes: 54 additions & 20 deletions addon/hint/sql-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"use strict";

var tables;
var defaultTable;
var keywords;
var CONS = {
QUERY_DIV: ";",
Expand Down Expand Up @@ -43,18 +44,55 @@
}
}

function columnCompletion(result, editor) {
function nameCompletion(result, editor) {
var cur = editor.getCursor();
var token = editor.getTokenAt(cur);
var useBacktick = (token.string.charAt(0) == "`");
var string = token.string.substr(1);
var prevCur = Pos(cur.line, token.start);
var table = editor.getTokenAt(prevCur).string;
if (!tables.hasOwnProperty(table))
table = findTableByAlias(table, editor);
var columns = tables[table];
if (!columns) return;

addMatches(result, string, columns, function(w) {return "." + w;});
var prevToken = editor.getTokenAt(Pos(cur.line, token.start));
if (token.string.charAt(0) == "." || prevToken.string == "."){
//Suggest colunm names
if (prevToken.string == ".") {
var prevToken = editor.getTokenAt(Pos(cur.line, token.start - 1));
}
var table = prevToken.string;
//Check if backtick is used in table name. If yes, use it for columns too.
var useBacktickTable = false;
if (table.match(/`/g)) {
useBacktickTable = true;
table = table.replace(/`/g, "");
}
//Check if table is available. If not, find table by Alias
if (!tables.hasOwnProperty(table))
table = findTableByAlias(table, editor);
var columns = tables[table];
if (!columns) return;

if (useBacktick) {
addMatches(result, string, columns, function(w) {return "`" + w + "`";});
}
else if(useBacktickTable) {
addMatches(result, string, columns, function(w) {return ".`" + w + "`";});
}
else {
addMatches(result, string, columns, function(w) {return "." + w;});
}
}
else {
//Suggest table names or colums in defaultTable
while (token.start && string.charAt(0) == ".") {
token = editor.getTokenAt(Pos(cur.line, token.start - 1));
string = token.string + string;
}
if (useBacktick) {
addMatches(result, string, tables, function(w) {return "`" + w + "`";});
addMatches(result, string, defaultTable, function(w) {return "`" + w + "`";});
}
else {
addMatches(result, string, tables, function(w) {return w;});
addMatches(result, string, defaultTable, function(w) {return w;});
}
}
}

function eachWord(lineText, f) {
Expand Down Expand Up @@ -128,30 +166,26 @@

CodeMirror.registerHelper("hint", "sql", function(editor, options) {
tables = (options && options.tables) || {};
var defaultTableName = options && options.defaultTable;
defaultTable = (defaultTableName && tables[defaultTableName] || []);
keywords = keywords || getKeywords(editor);

var cur = editor.getCursor();
var result = [];
var token = editor.getTokenAt(cur), start, end, search;
if (token.string.match(/^[.\w@]\w*$/)) {
if (token.string.match(/^[.`\w@]\w*$/)) {
search = token.string;
start = token.start;
end = token.end;
} else {
start = end = cur.ch;
search = "";
}
if (search.charAt(0) == ".") {
columnCompletion(result, editor);
if (!result.length) {
while (start && search.charAt(0) == ".") {
token = editor.getTokenAt(Pos(cur.line, token.start - 1));
start = token.start;
search = token.string + search;
}
addMatches(result, search, tables, function(w) {return w;});
}
if (search.charAt(0) == "." || search.charAt(0) == "`") {
nameCompletion(result, editor);
} else {
addMatches(result, search, tables, function(w) {return w;});
addMatches(result, search, defaultTable, function(w) {return w;});
addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
}

Expand Down
25 changes: 10 additions & 15 deletions addon/lint/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@

function startLinting(cm) {
var state = cm.state.lint, options = state.options;
var passOptions = options.options || options; // Support deprecated passing of `options` property in options
if (options.async)
options.getAnnotations(cm, updateLinting, options);
options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
else
updateLinting(cm, options.getAnnotations(cm.getValue(), options.options));
updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm));
}

function updateLinting(cm, annotationsNotSorted) {
Expand Down Expand Up @@ -170,20 +171,14 @@
showTooltipFor(e, annotationTooltip(ann), target);
}

// When the mouseover fires, the cursor might not actually be over
// the character itself yet. These pairs of x,y offsets are used to
// probe a few nearby points when no suitable marked range is found.
var nearby = [0, 0, 0, 5, 0, -5, 5, 0, -5, 0];

function onMouseOver(cm, e) {
if (!/\bCodeMirror-lint-mark-/.test((e.target || e.srcElement).className)) return;
for (var i = 0; i < nearby.length; i += 2) {
var spans = cm.findMarksAt(cm.coordsChar({left: e.clientX + nearby[i],
top: e.clientY + nearby[i + 1]}, "client"));
for (var j = 0; j < spans.length; ++j) {
var span = spans[j], ann = span.__annotation;
if (ann) return popupSpanTooltip(ann, e);
}
var target = e.target || e.srcElement;
if (!/\bCodeMirror-lint-mark-/.test(target.className)) return;
var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;
var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client"));
for (var i = 0; i < spans.length; ++i) {
var ann = spans[i].__annotation;
if (ann) return popupSpanTooltip(ann, e);
}
}

Expand Down
Loading