code: function prepareSelectAllHack(){if(te.selectionStart!=null){var selected=cm.somethingSelected();var extval='\u200B'+(selected?te.value:"");te.value='\u21DA';// Used to catch context-menu undo
  te.value=extval;input.prevInput=selected?"":'\u200B';te.selectionStart=1;te.selectionEnd=extval.length;// Re-set this, in case some other handler touched the
  // selection in the meantime.
  display.selForContextMenu=cm.doc.sel;}}
docs: Select-all will be greyed out if there's nothing to select, so this adds a zero-width space so that we can later check whether it got selected.