SCI_SETYCARETPOLICY question

31 views
Skip to first unread message

Héctor A

unread,
Nov 21, 2016, 11:21:40 AM11/21/16
to scintilla-interest
Is it possible to set a caret policy for only the right and bottom edges? Documentation and my own testing seem to suggest that no... but I thought it is worth asking. I'd like something like:

SCI_SETYCARETPOLICY(CARET_SLOP | CARET_STRICT | CARET_EVEN, 2);

But without the top and left margins affected if possible.

Also, is it possible to enforce this kind policy when placing the caret through mouse and not only by keyboard?

Neil Hodgson

unread,
Nov 22, 2016, 4:08:04 AM11/22/16
to scintilla...@googlegroups.com
Héctor A:

> Is it possible to set a caret policy for only the right and bottom edges?

So the document is never scrolled from moving the caret up?

> Also, is it possible to enforce this kind policy when placing the caret through mouse and not only by keyboard?

You can call SCI_ENSUREVISIBLEENFORCEPOLICY after mouse clicks.

Neil

Héctor A

unread,
Nov 22, 2016, 5:23:36 AM11/22/16
to scintilla-interest, nyama...@me.com

On Tuesday, November 22, 2016 at 10:08:04 AM UTC+1, Neil Hodgson wrote:
Héctor A:

> Is it possible to set a caret policy for only the right and bottom edges?

   So the document is never scrolled from moving the caret up?

Oh, I see... it seems I was getting the different caret policy combinations wrong... actually what I'd want would be independent bottom and top policies... different concept from what is currently in there. So I would say it's fine if my message is ignored in the end. If it has to come down to it, I think I can workaround into getting this, more work required and a bit hacky solution in my end, but I would say possible.
  

> Also, is it possible to enforce this kind policy when placing the caret through mouse and not only by keyboard?

   You can call SCI_ENSUREVISIBLEENFORCEPOLICY  after mouse clicks.

I was aware of this, but since I'm some layers above Scintilla plus I'm already using a different visible policy I was wondering if there was some built-in feature to shortcut this, but not a problem.
 
   Neil

Reply all
Reply to author
Forward
0 new messages