<p>In <a href="https://github.com/geany/geany/pull/1154#discussion_r72798342">src/editor.c</a>:</p>
<pre style='color:#555'>> @@ -5169,6 +5170,12 @@ void editor_apply_update_prefs(GeanyEditor *editor)
>    /* virtual space */
>    SSM(sci, SCI_SETVIRTUALSPACEOPTIONS, editor_prefs.show_virtual_space, 0);
>  
> +  /* caret Y policy */
> +  caret_y_policy = CARET_EVEN;
> +  if (editor_prefs.scroll_lines_around_cursor > 0)
> +          caret_y_policy |= CARET_SLOP | CARET_STRICT;
</pre>
<p>See <a href="http://www.scintilla.org/ScintillaDoc.html#SCI_SETYCARETPOLICY">http://www.scintilla.org/ScintillaDoc.html#SCI_SETYCARETPOLICY</a> for why the options are different: if the <em>caret slop</em> is set to 0 and <code>CARET_STRICT</code> is set, it would keep the caret centered, which is not what we want.  So use Scintilla's default unless we set the <em>caret slop</em> to something non-zero, in which case these additional flags keep it working the same, but adding an <em>unwanted zone</em> near the top and bottom edges.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1154/files/4ad652aa7d3179dc6da1dcd077d11b21cc5ca0cb#r72798342">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ4ZXWH02GyDuWy7Y36ma59DTIsZ3ks5qagtRgaJpZM4JYOtc">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ57wwpZZ0FlQKZYxd2Mudx860VZmks5qagtRgaJpZM4JYOtc.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/pull/1154/files/4ad652aa7d3179dc6da1dcd077d11b21cc5ca0cb#r72798342"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>