Skip to content

Commit 441a8e9

Browse files
authored
Fix "forward" in cheatsheet (#1525)
This is how `"backward"` looks: <img width="540" alt="image" src="https://github.com/cursorless-dev/cursorless/assets/755842/e196de38-a3db-445c-af29-61758317e39e"> But `"forward"` didn't have the same special treatment: <img width="550" alt="image" src="https://github.com/cursorless-dev/cursorless/assets/755842/00a87f25-c806-4984-a25f-f9f9c3855e25"> This PR makes it look as follows: <img width="546" alt="image" src="https://github.com/cursorless-dev/cursorless/assets/755842/80bfee7f-cf4b-437d-b980-10eb68434796"> I also updated the cheatsheet json that we use to generate the [generic cheatsheet](https://www.cursorless.org/cheatsheet) while I was here ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] 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) - [x] I have not broken the cheatsheet
1 parent dada878 commit 441a8e9

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

cursorless-talon/src/cheatsheet/sections/modifiers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def get_modifiers():
2626
"previous",
2727
"next",
2828
"backward",
29+
"forward",
2930
]
3031
simple_modifiers = {
3132
key: value
@@ -125,6 +126,10 @@ def get_modifiers():
125126
"spokenForm": f"<scope> {complex_modifiers['backward']}",
126127
"description": "single instance of <scope> including target, going backwards",
127128
},
129+
{
130+
"spokenForm": f"<scope> {complex_modifiers['forward']}",
131+
"description": "single instance of <scope> including target, going forwards",
132+
},
128133
{
129134
"spokenForm": f"<number> <scope>s {complex_modifiers['backward']}",
130135
"description": "<number> instances of <scope> including target, going backwards",

packages/cheatsheet/src/lib/sampleSpokenFormInfos/defaults.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,16 @@
708708
}
709709
]
710710
},
711+
{
712+
"id": "inferPreviousMark",
713+
"type": "modifier",
714+
"variations": [
715+
{
716+
"spokenForm": "its",
717+
"description": "Infer previous mark"
718+
}
719+
]
720+
},
711721
{
712722
"id": "interiorOnly",
713723
"type": "modifier",
@@ -794,6 +804,14 @@
794804
"spokenForm": "previous <number> <scope>s",
795805
"description": "previous <number> instances of <scope>"
796806
},
807+
{
808+
"spokenForm": "<scope> backward",
809+
"description": "single instance of <scope> including target, going backwards"
810+
},
811+
{
812+
"spokenForm": "<scope> forward",
813+
"description": "single instance of <scope> including target, going forwards"
814+
},
797815
{
798816
"spokenForm": "<number> <scope>s backward",
799817
"description": "<number> instances of <scope> including target, going backwards"
@@ -1056,6 +1074,16 @@
10561074
}
10571075
]
10581076
},
1077+
{
1078+
"id": "branch",
1079+
"type": "scopeType",
1080+
"variations": [
1081+
{
1082+
"spokenForm": "branch",
1083+
"description": "Branch"
1084+
}
1085+
]
1086+
},
10591087
{
10601088
"id": "chapter",
10611089
"type": "scopeType",
@@ -1186,6 +1214,16 @@
11861214
}
11871215
]
11881216
},
1217+
{
1218+
"id": "identifier",
1219+
"type": "scopeType",
1220+
"variations": [
1221+
{
1222+
"spokenForm": "identifier",
1223+
"description": "Identifier"
1224+
}
1225+
]
1226+
},
11891227
{
11901228
"id": "ifStatement",
11911229
"type": "scopeType",
@@ -1196,6 +1234,16 @@
11961234
}
11971235
]
11981236
},
1237+
{
1238+
"id": "instance",
1239+
"type": "scopeType",
1240+
"variations": [
1241+
{
1242+
"spokenForm": "instance",
1243+
"description": "Instance"
1244+
}
1245+
]
1246+
},
11991247
{
12001248
"id": "line",
12011249
"type": "scopeType",
@@ -1386,6 +1434,16 @@
13861434
}
13871435
]
13881436
},
1437+
{
1438+
"id": "unit",
1439+
"type": "scopeType",
1440+
"variations": [
1441+
{
1442+
"spokenForm": "unit",
1443+
"description": "Unit"
1444+
}
1445+
]
1446+
},
13891447
{
13901448
"id": "url",
13911449
"type": "scopeType",

0 commit comments

Comments
 (0)