I'm using Twitter API to scheldule Tweets. The App have a Create Template module, I would like to accomplish something like this using CodeMirror:
My actual mode definer looks like:
CodeMirror.defineMode('text/twitter-like', function() {
return {
token: function( word, state ){
if ( word.match(/^_\w+/) ) {
return "blue-text";
}
return false;
}
};
});
This is making a infinite loop every time I type something.
The CodeMirror Manual states:
It should read one token from the stream it is given as an argument, optionally update its state, and return a style string, or null for tokens that do not have to be styled.
Did you try to return null
instead of false
?