NSLayoutManager setAllowsNonContiguousLayout misplaces caret
-
28-09-2019 - |
Question
With setAllowsNonContiguousLayout
set to YES, if I perform the following steps I get weird behaviour:
- Select all text in the NSTextView
- Hit backspace to remove all the text
- Type a few lines of text
- Trying using backspace to delete the text again
At step 4 the cursor jumps up to the line above and at a seemingly random point on the line, yet the actual glyphs are deleted from the correct location.
Is non-contiguous layout a bit experimental/buggy like this? If I turn it off things work as expected.
I'll file a bug report with Apple, but has anybody else seen this behaviour and worked around it?
Solution
A bug report is the right way to go, I think. From what I've heard is that non-contignuous layout has caused lots of headaches to some developers making them drop that feature again from their application. As nice as it sounds, it seemingly is hell of a thing to get to work right ... even for Apple.