Skip to content

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Nov 20, 2024

I got unreliable behavior when we didn't have a default value here. Turns out that if you don't have a default value settings.get(id, default) will not actually return none or your specified default value. It will return a NoValueType object and that is evaluated to true in the if statements so everybody probably has preferred scope on now. This might be a change to Talon because I can't believe we didn't catch this earlier.

Checklist

  • [/] I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

@AndreasArvidsson AndreasArvidsson requested a review from a team as a code owner November 20, 2024 02:28
@phillco phillco enabled auto-merge November 20, 2024 02:33
@phillco phillco added this pull request to the merge queue Nov 20, 2024
Merged via the queue into main with commit 878676b Nov 20, 2024
15 checks passed
@phillco phillco deleted the preferredScopeSetting branch November 20, 2024 02:59
cursorless-bot pushed a commit that referenced this pull request Nov 20, 2024
I got unreliable behavior when we didn't have a default value here.
Turns out that if you don't have a default value get will not actually
return none. It will return a `NoValueType` object and that is evaluated
to true in the if statements so everybody probably has preferred scope
on now. This might be a change to Talon because I can't believe we
didn't catch this earlier.

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet
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.

2 participants