简体   繁体   English

NSLayoutManager setAllowsNonContiguousLayout放错了插入符号

[英]NSLayoutManager setAllowsNonContiguousLayout misplaces caret

With setAllowsNonContiguousLayout set to YES, if I perform the following steps I get weird behaviour: setAllowsNonContiguousLayout设置为YES的情况下,如果执行以下步骤,则会出现奇怪的行为:

  1. Select all text in the NSTextView 选择NSTextView中的所有文本
  2. Hit backspace to remove all the text 按退格键删除所有文本
  3. Type a few lines of text 输入几行文字
  4. 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. 在第4步中,光标跳到上面的行,并跳到该行上的看似随机的点,但是实际的字形已从正确的位置删除。

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? 我将向Apple提交错误报告,但是其他人是否看到过这种现象并可以解决?

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. 听起来似乎不错,但即使对于苹果公司来说,正确工作似乎也是一件令人头疼的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM