title: Replace CodeMirror token?
body: <p>I'm trying to replace a token selected in CodeMirror v3 via</p>
  
  <pre><code>var obj = editor.getTokenAt(currLine);
  var currLine = editor.getCursor(true);  
  </code></pre>
  
  <p>but it seems like the only options are to do </p>
  
  <pre><code>replaceRange
  </code></pre>
  
  <p>which takes the new string and the start position into consideration, but weird things happen when the new string is shorter or longer than the original.</p>
  
  <p>What's a better way to do it? </p>
  
  <pre><code>currLinereplace 
  </code></pre>
  
  <p>doesn't seem to work for me.</p>
  
  <p>Thanks!</p>