Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some performance issues (#182)
<!--- IMPORTANT: If this PR addresses multiple unrelated issues, it will be closed until separated. --> ### 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 <!--- Add things that are not yet implemented above --> - [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md) - [x] The issues this PR addresses are related to each other - [x] My changes generate no new warnings - [x] My code builds and runs on my machine - [x] My changes are all related to the related issue above - [x] I documented my code ### Screenshots <!--- REQUIRED: if issue is UI related --> <!--- IMPORTANT: Fill out all required fields. Otherwise we might close this PR temporarily --> Signed-off-by: Wouter01 <[email protected]>
- Loading branch information