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

fix(#13): Separate Cursor Updates, Fix Focus Issues #14

Merged
merged 3 commits into from
Jan 28, 2024

Conversation

thecoolwinter
Copy link
Contributor

@thecoolwinter thecoolwinter commented Jan 16, 2024

Description

Fixes:

  • Cursors used a globally shared timer, meaning two instances of the view would share cursor timers.
  • When releasing first responder, an update would be sent from the selection manager, causing in some cases a second update to the text selection, causing cursor views to be added back to the view after releasing first responder.

Changes:

  • Cursors now use a blink timer that's a property of TextSelectionManager. This timer is also now it's own class that notifies cursor views of blink state.
  • Modified all of the selection modification methods to only update display if the view is the first responder.

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

N/A

Copy link
Contributor

@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

@austincondiff austincondiff merged commit fad3087 into CodeEditApp:main Jan 28, 2024
2 checks passed
thecoolwinter added a commit to CodeEditApp/CodeEditSourceEditor that referenced this pull request Feb 4, 2024
<!--- IMPORTANT: If this PR addresses multiple unrelated issues, it will
be closed until separated. -->

### Description

Finishes the required changes to make
[CodeEditTextView#14](CodeEditApp/CodeEditTextView#14)
work in CESE, once those changes are merged with a package update.

Removes the first responder acquisition when updating cursors, the text
view should handle focus state and does so correctly on the main branch.
Also fixes a small ordering bug with a check variable related to this
issue.

### Related Issues

<!--- REQUIRED: Tag all related issues (e.g. * #123) -->
<!--- If this PR resolves the issue please specify (e.g. * closes #123)
-->
<!--- If this PR addresses multiple issues, these issues must be related
to one other -->

* CodeEditTextView issue, no issues created here.

### 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

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 Cursors use shared blink timer
2 participants