Skip to content

Conversation

@thecoolwinter
Copy link
Contributor

@thecoolwinterthecoolwinter 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

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

Labels

bugSomething isn't working

Projects

None yet

2 participants

@thecoolwinter@austincondiff