diff --git a/ChangeLog b/ChangeLog index 0b6f29f02..6d894e02d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-11-19 21:53 Alexander Malmberg + + * Source/NSTextView.m (-sizeToFit): If we are horizontally resizable + and the inset width is 0, increase our width by 1. + 2003-11-19 17:06 Alexander Malmberg * Tools/GNUmakefile, Tools/example.m, Tools/exampleInfo.plist, diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 6568f3e83..d75741bb5 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -1432,7 +1432,18 @@ incorrectly. */ if (!_tf.is_horizontally_resizable) size.width = _bounds.size.width; else - size.width += 2 * _textContainerInset.width; + { + size.width += 2 * _textContainerInset.width; + + /* + The +1 is to make sure that we always have one extra point on the right + where we can draw the insertion pointer for a character that touches + the right edge. This is a bit of a hack, but the insertion pointer + often disappears in field editors without this. + */ + if (!_textContainerInset.width) + size.width += 1; + } if (!_tf.is_vertically_resizable) size.height = _bounds.size.height;