NSLayoutManager setAllowsNonContigouslyLayout 放错插入符位置

发布于 2024-09-29 17:41:37 字数 312 浏览 0 评论 0原文

将 setAllowsNonContigouslyLayout 设置为 YES 时,如果执行以下步骤,我会得到奇怪的行为:

  1. 选择 NSTextView 中的所有文本
  2. 按退格键删除所有文本
  3. 输入几行文本
  4. 尝试使用退格键删除文本再次

在步骤 4 中,光标跳到上面的行以及该行上看似随机的点,但实际的字形已从正确的位置删除。

像这样的非连续布局是否有点实验性/有缺陷?如果我把它关掉,事情就会按预期进行。

我将向 Apple 提交错误报告,但有其他人看到此行为并解决它吗?

With setAllowsNonContiguousLayout set to YES, if I perform the following steps I get weird behaviour:

  1. Select all text in the 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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过期情话 2024-10-06 17:41:37

我认为错误报告是正确的方法。据我所知,非连续布局给一些开发人员带来了很多麻烦,使他们再次从应用程序中删除该功能。尽管听起来不错,但要正常工作似乎是一件地狱般的事情……即使对苹果来说也是如此。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文