Skip to content

Commit 878676b

Browse files
Default value for preferred scope setting (#2687)
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
1 parent 8cf3464 commit 878676b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cursorless-talon/src/modifiers/simple_scope_modifier.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
# This is a private setting and should not be used by non Cursorless developers
1717
mod.setting(
1818
"private_cursorless_use_preferred_scope",
19-
bool,
19+
type=bool,
20+
default=False,
2021
desc="Use preferred scope instead of containing scope for all scopes by default (EXPERIMENTAL)",
2122
)
2223

@@ -42,7 +43,7 @@ def cursorless_simple_scope_modifier(m) -> dict[str, Any]:
4243
"ancestorIndex": 1,
4344
}
4445

45-
if settings.get("user.private_cursorless_use_preferred_scope", False):
46+
if settings.get("user.private_cursorless_use_preferred_scope"):
4647
return {
4748
"type": "preferredScope",
4849
"scopeType": m.cursorless_scope_type,

0 commit comments

Comments
 (0)