Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some performance issues #182

Merged
merged 1 commit into from
Apr 29, 2023
Merged

Conversation

Wouter01
Copy link
Member

@Wouter01 Wouter01 commented Apr 29, 2023

Description

This PR fixes an issue where the view would be reloaded too often. This happened because updateNSViewController is called too often. This mostly happens because of a change in the environment, which gets passed to the NSViewControllerRepresentable in the context variable.

Manual diffing is applied to check if any variables that matter have changed. If not, nothing is updated.

The initializer has also changed, a few variables are now just values instead of bindings. These don't have to be bindings, as the textview won't update variables.

Related Issues

CodeEditApp/CodeEdit#1247

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

@Wouter01 Wouter01 added the bug Something isn't working label Apr 29, 2023
Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Yeah if these variables will not ever be set from within, there really is no point in those bindings.

@matthijseikelenboom matthijseikelenboom merged commit 045bd35 into CodeEditApp:main Apr 29, 2023
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
Development

Successfully merging this pull request may close these issues.

3 participants