<p>Ok, think I have it, split initially splits the line after the 'a's so the next line starts with lots of spaces, then the "lookup split position" loop backs pos to the start of the line since its all spaces before the split position, the the next loop does nothing since the first character on the line is a space, so it inserts a newline there, and keeps going</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany/issues/848#issuecomment-168575463">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJyWi4eYPHlJABlRwNFeEhe0Xk5PBks5pWeRLgaJpZM4G9vAU.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/848#issuecomment-168575463"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>