Block caret

54 views
Skip to first unread message

Nicholai Benalal

unread,
Jan 9, 2011, 6:18:52 PM1/9/11
to scintilla...@googlegroups.com
Hello,

Over recent months I have ported Scintilla to the Morphos operating system (which is likely to be unknown to almost everyone :) and implemented an editor around it. I'm overall I'm very happy with Scintilla and its api and now only have some smaller issues to sort out with my port. 

One question though, the block caret mode (CARETSTYLE_BLOCK) seems to behave a bit funny. When selecting text in this mode, one would expect to click on top of a charactar to start selection from that point and not between two chars as in line caret mode. Unless I'm overseeing something, it's very easy to select the charactar next to the intended one by mistake. Any ideas on this?

Best,

Nicholai

Neil Hodgson

unread,
Jan 9, 2011, 8:27:07 PM1/9/11
to scintilla...@googlegroups.com
Nicholai Benalal:

> One question though, the block caret mode (CARETSTYLE_BLOCK) seems to behave
> a bit funny. When selecting text in this mode, one would expect to click on
> top of a charactar to start selection from that point and not between two
> chars as in line caret mode. Unless I'm overseeing something, it's very easy
> to select the charactar next to the intended one by mistake. Any ideas on
> this?

I expect the block caret was implemented for a vi emulation mode,
and didn't change anything not needed for that.

Neil

Nicholai Benalal

unread,
Jan 10, 2011, 4:17:18 AM1/10/11
to scintilla...@googlegroups.com

---------

 

Hello,

 

Yes, I understand but I would be surprised if this is the way vi or vim behaves. Actually, my issue seems very much related to the word selection patch you just commited (which I haven't had the time to try yet):

 

"Thus the mouse click is now resolved to a character position rather than an inter-character position"

 

If I understand it correctly, that change only applies to double clicks. However, I think the same behaviour would be expected for a single click + drag when marking text. This would be independent of the caret style.

 

In addition, in caret blockstyle mode even a single mouse click without drag should always be resolved to a character position. That's at least how I would expect it.

 

Best,

 

Nicholai

Neil Hodgson

unread,
Jan 10, 2011, 5:28:31 AM1/10/11
to scintilla...@googlegroups.com
Nicholai Benalal:

> "Thus the mouse click is now resolved to a character position rather than an
> inter-character position"
>
> If I understand it correctly, that change only applies to double clicks.
> However, I think the same behaviour would be expected for a single click +
> drag when marking text. This would be independent of the caret style.

Ever since Smalltalk, GUI editors have resolved mouse clicks to
inter-character positions rather than character positions.

See Byte August 1981, section "Making a Selection":
http://carlstrom.com/stanford/cs242/readings/11.pdf

Neil

Nicholai Benalal

unread,
Jan 10, 2011, 7:13:54 AM1/10/11
to scintilla...@googlegroups.com
On 10 jan 2011 11:28 "Neil Hodgson" <nyama...@gmail.com> wrote:

Ever since Smalltalk, GUI editors have resolved mouse clicks to
inter-character positions rather than character positions.

See Byte August 1981, section "Making a Selection":
http://carlstrom.com/stanford/cs242/readings/11.pdf

------------

 

Seems you're right but at least from that description it seems that Smalltalk would show a line caret in the intercharacter gap for the "draw-through" operation. I don't know if it did use a block caret at all.

 

Personally, I don't see the logic of selecting the charactar next to the one the user clicks on in block caret mode. The editors I'm used to don't do that (and they are indeed not older than 1981 ;-) but maybe that differs between editors.

Reply all
Reply to author
Forward
0 new messages