[Github-comments] [geany/geany] Add support for keeping the cursor a number of lines from the edges (#1154)
Colomban Wendling
notifications at xxxxx
Fri Jul 29 14:16:49 UTC 2016
> @@ -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;
See http://www.scintilla.org/ScintillaDoc.html#SCI_SETYCARETPOLICY for why the options are different: if the *caret slop* is set to 0 and `CARET_STRICT` is set, it would keep the caret centered, which is not what we want. So use Scintilla's default unless we set the *caret slop* to something non-zero, in which case these additional flags keep it working the same, but adding an *unwanted zone* near the top and bottom edges.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1154/files/4ad652aa7d3179dc6da1dcd077d11b21cc5ca0cb#r72798342
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160729/1483715e/attachment.html>
More information about the Github-comments
mailing list