title: How to set cursor position in Codemirror editor
body: <p>I am implementing <strong>"find and correct"</strong> functionality using codemirror. I know there is an addon for <strong>search and replace</strong>, but it doesn't fulfill my requirement. the editor is for writing particular queries. It creates spans in </p>
  
  <p><code>&lt;pre&gt;
       &lt;span class="cm-field"&gt;field&lt;/span&gt;:jet &lt;span class="cm-other-operator active" &gt;adj3&lt;/span&gt; engine &lt;span class="cm-operator"&gt;OR&lt;/span&gt; jet &lt;span class="cm-other-operator" &gt;near5&lt;/span&gt; engine 
  &lt;/pre&gt;</code></p>
  
  <p>please refer snapshot.
  If i click on any of the operator (orange colored), the cursor starts blinking there and the functionality is working. On clicking <strong>find next</strong> button i am able to find the respective span but unble to set cursor there. So How can i set Cursor position there. Thanks in advance.
  <a href="https://i.stack.imgur.com/oijms.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oijms.png" alt="enter image description here"></a></p>