nl_tokens: Actually parse the input and make sure we re all up to date
pl_tokens: function ( ) { this . isUpdating = true ; var input = { typed : this . element . value , cursor : { start : dom . getSelectionStart ( this . element ) , end : dom . getSelectionEnd ( this . element . selectionEnd ) } } ; this . cli . update ( input ) ; var display = this . cli . getAssignmentAt ( input . cursor . start ) . getHint ( ) ; // 1. Update the completer with prompt/error marker/TAB info dom . removeCssClass ( this . completer , Status . VALID . toString ( ) ) ; dom . removeCssClass ( this . completer , Status . INCOMPLETE . toString ( ) ) ; dom . removeCssClass ( this . completer , Status . INVALID . toString ( ) ) ; var completion = '<span class="cptPrompt">&gt;</span> ' ; if ( this . element . value . length > 0 ) { var scores = this . cli . getInputStatusMarkup ( ) ; completion += this . markupStatusScore ( scores ) ; } // Display the "-> prediction" at the end of the completer if ( this . element . value . length > 0 && display . predictions && display . predictions . length > 0 ) { var tab = display . predictions [ 0 ] ; completion += ' &nbsp;&#x21E5; ' + ( tab . name ? tab . name : tab ) ; } this . completer . innerHTML = completion ; dom . addCssClass ( this . completer , this . cli . getWorstHint ( ) . status . toString ( ) ) ; // 2. Update the hint element var hint = '' ; if ( this . element . value . length !== 0 ) { hint += display . message ; if ( display . predictions && display . predictions . length > 0 ) { hint += ': [ ' ; display . predictions . forEach ( function ( prediction ) { hint += ( prediction . name ? prediction . name : prediction ) ; hint += ' | ' ; } , this ) ; hint = hint . replace ( / \| $ / , ']' ) ; } } this . hinter . innerHTML = hint ; if ( hint . <mask> === 0 ) { dom . addCssClass ( this . hinter , 'cptNoPopup' ) ; } else { dom . removeCssClass ( this . hinter , 'cptNoPopup' ) ; } this . isUpdating = false ; }