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.
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 thecontext
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
https://github.com/CodeEditApp/CodeEdit/issues/1247
Checklist
Screenshots