Skip to content

Conversation

@thecoolwinter
Copy link
Contributor

@thecoolwinter thecoolwinter commented Oct 12, 2024

Description

Fixes a bug where line fragment views were being removed from layout despite the lines still existing. This was caused by overlapping layoutLines calls in the layout manager, which in turn were caused by a CATransaction.commit() call. This transaction was unnecessary and was removed.

When commit() was called, the text view's NSView.layout method was triggered, causing layout again starting in the middle of the existing layout pass. However, the layout is not reentrant and this caused some line fragment views to be marked as missing and subsequently removed.

To prevent errors similar to this in the future, a debug-only flag was added during layout and is asserted when layout begins.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2024-10-12.at.1.27.13.PM.mov

@thecoolwinter thecoolwinter changed the title Remove Problematic CATransaction Remove Problematic CATransaction, Fix Lines Disappearing Oct 12, 2024
@thecoolwinter thecoolwinter added the bug Something isn't working label Oct 12, 2024
@austincondiff austincondiff merged commit e5369da into CodeEditApp:main Oct 12, 2024
@thecoolwinter thecoolwinter deleted the fix/lines-dissapearing branch October 13, 2024 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

2 participants