nl_tokens: Find expression bounds in current editor at caret position . On each character a <code > fn< / code > function will be called and must return <code > true< / code > if current character meets requirements <code > false< / code > otherwise
pl_tokens: function ( editor , fn ) { var <mask> = String ( editor . getContent ( ) ) ; var il = content . length ; var exprStart = editor . getCaretPos ( ) - 1 ; var exprEnd = exprStart + 1 ; // start by searching left while ( exprStart >= 0 && fn ( content . charAt ( exprStart ) , exprStart , content ) ) exprStart -- ; // then search right while ( exprEnd < il && fn ( content . charAt ( exprEnd ) , exprEnd , content ) ) exprEnd ++ ; if ( exprEnd > exprStart ) { return require ( 'range' ) . create ( [ ++ exprStart , exprEnd ] ) ; } }