I've recently met a problem that once I'm adding a new line in an NSTextView, the least visible line disappears for a moment. The same happens when I'm deleting a line.
The problem occurs even in a newly created Xcode project with pure NSTextView. Here is a quick preview (GIF):
Here is the text I'm playing with (4 lines):
aa
Has anyone met this problem?
CodePudding user response:
The solutions is to set this allowsNonContiguousLayout
of the LayoutManager to false
, e.g.:
textView.layoutManager.allowsNonContiguousLayout = false