nl_tokens: Search for abbreviation in editor from current caret position
pl_tokens: function ( editor ) { /** @type Range */ var range = require ( 'range' ) . create ( editor . getSelectionRange ( ) ) ; var content = String ( editor . getContent ( ) ) ; if ( range . length ( ) ) { // abbreviation is selected by user return range . substring ( content ) ; } // search for new abbreviation from current caret position var curLine = editor . getCurrentLineRange ( ) ; return require ( 'actionUtils' ) . extractAbbreviation ( content . substring ( curLine . start , range . <mask> ) ) ; }