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

Observe mousemoveevent option #2111

Merged
merged 5 commits into from
Nov 8, 2023
Merged

Observe mousemoveevent option #2111

merged 5 commits into from
Nov 8, 2023

Conversation

Kethku
Copy link
Member

@Kethku Kethku commented Nov 8, 2023

Tracks the mousemoveevent option so that we dont send mouse move events when we shouldn't.
To do this I updated our settings infrastructure to allow option settings. This is done by adding an option attribute to the field that should be backed by an option instead of a global variable. For now all options require a name as they are normally named by neovim and have strange conventions.

While I was in these systems I also added a Changed event which is raised whenever a field on a setting object is updated. This allowed me to remove our current option observation code in favor of tracking updated events.

@fredizzimo to do this I recombined the keyboard settings and window settings structs so that they could both be handled in one location. I believe you introduced that change (maybe) so lmk if you think that will cause problems. Another possible solution for this might be to allow our event system to have multiple subscribers. I didn't go this route because thats a larger change that I didn't want to sneak in here. But I could be convinced if somebody feels strongly.

Fixes #1838

What kind of change does this PR introduce?

  • Fix

Did this PR introduce a breaking change?

  • Yes
    Global variable Neovide settings are no longer set in nvim on startup.

This feature was a bit odd from the start as I don't really see the use case beyond maybe giving auto completes for variables on startup? I removed it because option values are best implemented via an Option type. Since we don't own the Option or Value types, I couldn't implement From for Option which I needed for lines and columns. I could see a usecase for bidirectional settings in the future, but this initial setting seems of limited value. However on the off chance somebody depends on it, I'm capturing the change here.

@Kethku Kethku force-pushed the observe-mousemoveevent-option branch from 2877a44 to 8a4f44f Compare November 8, 2023 03:48
Copy link

github-actions bot commented Nov 8, 2023

Test Results

    3 files      3 suites   6s ⏱️
  98 tests   98 ✔️ 0 💤 0
294 runs  294 ✔️ 0 💤 0

Results for commit 8a4f44f.

@Kethku Kethku merged commit 03a8429 into main Nov 8, 2023
15 checks passed
@MultisampledNight MultisampledNight deleted the observe-mousemoveevent-option branch November 10, 2023 09:17
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.

Moving cursor forces user out of terminal mode (i3)
1 participant