title: JavaScript text editor with cursor jumping functionality
body: <p>I'm triing to implement a custom JavaScript text editor with CodeMirror. I've implemented a feature, which inserts the following code to the textarea of the editor when I click on a button:</p>
  
  <pre><code>if () then () else ()
  </code></pre>
  
  <p>After the insertion I would like to position the cursor between the first brackets. When the user pushes tab button the cursor should jump between the second brackets, and if he/she pushes it again the cursor should jump betweeb the third one. How can I implement it?</p>
  
  <p>Thank You in advance.</p>