I am having a bit of difficultly re the auto complete function in code mirror. What I am trying to do is two things (both which I am struggling with):
1) I want to enable auto complete for both HTML
and JavaScript
.
Currently I can only get one working at a time using e.g.:
CodeMirror.commands.autocomplete = function (cm) {
CodeMirror.showHint(cm, CodeMirror.hint.html);
};
How can I add the CodeMirror.hint.javascript
to the list from the HTML
one?
2) (Kind of more important) -- How can I add custom variables to the list of hints from HTML
which area retrieved from an ajax call.....
i.e. I want to have the drop down show up with the current list of data from the html hints, but then add custom entries such as ##SomeCode1##
and ##SomeCode2##
I have two problems here. First when I try to hard code the values in the 'html-hint.js' file the values all get appended with <
... which is not what I want.
The second problem, kind of, is that I believe I have to write a new 'html-hint.js' file correct? I mean there is no way to pass anything in the 'options' parameter in the CodeMirror.hint.html
above is there, to essentially merge two list.
I guest one and two are kind of the same come to think of it... Merging two lists of values for auto complete together.
I am guessing there is nothing already in the framework and I have to write a custom hint file, correct?
Any pointers would be appreciated. Sample code would be awesome.