Skip to content
Snippets Groups Projects
Commit aadd181c authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

Integrate xml-hint utility

parent dff021ce
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,11 @@
<form><textarea id="code" name="code"></textarea></form>
<p>Type '&lt;' or space inside tag or press Ctrl+Enter <strong>ctrl-space</strong> to activate autocompletion. See
<p>Type '&lt;' or space inside tag or
press <strong>ctrl-space</strong> to activate autocompletion. See
the code (<a href="../lib/util/simple-hint.js">here</a>
and <a href="../lib/util/xml-hint.js">here</a>) to figure out
how it works.</p>
and <a href="../lib/util/xml-hint.js">here</a>) to figure out how
it works.</p>
<script>
CodeMirror.xmlHints['<'] = [
......
......@@ -110,6 +110,7 @@
<option value="http://codemirror.net/lib/util/runmode.js">runmode.js</option>
<option value="http://codemirror.net/lib/util/simple-hint.js">simple-hint.js</option>
<option value="http://codemirror.net/lib/util/javascript-hint.js">javascript-hint.js</option>
<option value="http://codemirror.net/lib/util/xml-hint.js">xml-hint.js</option>
<option value="http://codemirror.net/lib/util/foldcode.js">foldcode.js</option>
<option value="http://codemirror.net/lib/util/dialog.js">dialog.js</option>
<option value="http://codemirror.net/lib/util/search.js">search.js</option>
......
......@@ -89,7 +89,7 @@
<h2 style="margin-top: 0">Usage demos:</h2>
<ul>
<li><a href="demo/complete.html">Autocompletion</a></li>
<li><a href="demo/complete.html">Autocompletion</a> (<a href="demo/xmlcomplete.html">XML</a>)</li>
<li><a href="demo/search.html">Search/replace</a></li>
<li><a href="demo/folding.html">Code folding</a></li>
<li><a href="demo/mustache.html">Mode overlays</a></li>
......
......@@ -3,7 +3,6 @@
// We want a single cursor position.
if (editor.somethingSelected()) return;
//don't show completion if the token is empty
//is it possible to make option for this? xml-hints.js use space for tag's propery autocomplete
var tempToken = editor.getTokenAt(editor.getCursor());
if(!(/[\S]/gi.test(tempToken.string))) return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment