[squeak-dev] How to reserve a small spacing for displaying the text cursor ?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Oct 2 22:16:09 UTC 2013


Though leftMargin is nil and indentation are apparently set to zero, the
TextMorph is always displayed with a small spacing from the left border and
right border.
This was quite long to find, but I now know:

PluggableTextMorph>>resizeScroller
    "Also needs to resize the text morph"

    super resizeScroller.
    textMorph ifNotNil:
        [textMorph extent: (self innerBounds width-6)@self height].

Unfortunately, this space is not available for displaying the cursor,
because it does not belong to the TextMorph...

The cursor is always displayed to the right of CharacterBlock.
So when at the left of the line it is inside TextMorph bounds and visible
because away from the borders thanks to above 3 pixels guard.
At the right of the line, it is generally visible, unless your last
character unluckily fits exactly to the right bound.
But if you rightFlush/justify, the characters are then perfectly aligned,
and the cursor to the right of a line becomes invisible.

It would not be unreasonnable to add some small indents to the style rather
than letting the 0, but I feel like the 6 pixels could be given back to the
TextMorph with a settable property, so that the Cursor could be
displayed....

What do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20131003/66282e49/attachment.htm


More information about the Squeak-dev mailing list