Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

Commit 0278c63

Browse files
committed
Merge branch 'master' into stable
2 parents 5a68ac0 + 6ea66d9 commit 0278c63

File tree

10 files changed

+240
-86
lines changed

10 files changed

+240
-86
lines changed

browser/src/Services/Learning/Tutorial/Notes.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ export const UKey = (): JSX.Element => {
116116
return <KeyWithDescription keyCharacter="u" description={<span>Undo a single change</span>} />
117117
}
118118

119+
export const RedoKey = (): JSX.Element => {
120+
return (
121+
<KeyWithDescription keyCharacter="Ctrl-r" description={<span>Redo a single undo</span>} />
122+
)
123+
}
124+
119125
export const GGKey = (): JSX.Element => {
120126
return (
121127
<KeyWithDescription
@@ -233,7 +239,7 @@ export const DeleteOperatorKey = (): JSX.Element => {
233239
keyCharacter="d"
234240
description={
235241
<span>
236-
<Bold>+ motion</Bold>: Deletes text specified by a `motion`. Examples:
242+
<Bold>+ motion</Bold>: Deletes text specified by a `motion`
237243
</span>
238244
}
239245
/>
@@ -278,7 +284,7 @@ export const ChangeOperatorKey = (): JSX.Element => {
278284
keyCharacter="c"
279285
description={
280286
<span>
281-
<Bold>+ motion</Bold>: Change text specified by a `motion`. Examples:
287+
<Bold>+ motion</Bold>: Change text specified by a `motion`
282288
</span>
283289
}
284290
/>

browser/src/Services/Learning/Tutorial/Tutorials/BeginningsAndEndingsTutorial.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ export class BeginningsAndEndingsTutorial implements ITutorial {
3434
new Stages.MoveToGoalStage("Use '0' to move to the BEGINNING of the line", 1, 0),
3535
new Stages.SetBufferStage([Line1, Line2, Line3]),
3636
new Stages.MoveToGoalStage("Use `j` to move down to the next line", 2),
37-
new Stages.MoveToGoalStage("Use '_' to move to the FIRST CHARACTER", 2, 4),
37+
new Stages.MoveToGoalStage(
38+
"Use '_' to move to the FIRST NON-WHITESPACE CHARACTER",
39+
2,
40+
4,
41+
),
3842
new Stages.MoveToGoalStage(
3943
"Use '$' to move to the END of the line",
4044
2,
4145
Line3.length - 1,
4246
),
43-
new Stages.MoveToGoalStage("Use '_' to move to the FIRST CHARACTER", 2, 4),
47+
new Stages.MoveToGoalStage(
48+
"Use '_' to move to the FIRST NON-WHITESPACE CHARACTER",
49+
2,
50+
4,
51+
),
4452
new Stages.MoveToGoalStage("Use '0' to move to the BEGINNING of the line", 2, 0),
4553
new Stages.MoveToGoalStage(
4654
"Use '$' to move to the END of the line",
@@ -53,9 +61,9 @@ export class BeginningsAndEndingsTutorial implements ITutorial {
5361
public get metadata(): ITutorialMetadata {
5462
return {
5563
id: "oni.tutorials.beginnings_and_endings",
56-
name: "Motion: _, 0, $",
64+
name: "Start/End Motion: _, 0, $",
5765
description:
58-
"You don't need to keep hitting `w` or `b` when you need to go all the way to the beginning or the end of a line. You can use the `0` key to move to the very beginning a line, and `$` to move to the end. Also, `_` moves to the first character in the line, which is often more convenient than `0`.",
66+
"You don't need to keep hitting `w` or `b` when you need to go all the way to the beginning or the end of a line. You can use the `0` key to move to the very beginning a line, and `$` to move to the end. Also, `_` moves to the first non-whitespace character in the line, which is often more convenient than `0`.",
5967
level: 140,
6068
}
6169
}

browser/src/Services/Learning/Tutorial/Tutorials/DeleteOperatorTutorial.tsx

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ const Line3c = "--> using the `dk` command."
2222
const Line2d = "--> The delete operator works with other motions, too."
2323
const Line3d = "--> Let's try out `dw` - delete word. Delete the duplicate words below:"
2424
const Line4d = "--> Help delete the duplicate duplicate words."
25-
const Line4dCorrect = "--> Help delete the duplicate words."
25+
const Line4dCorrecta = "--> Help delete the duplicate words."
26+
const Line4dCorrectb = "--> Help delete the words."
27+
28+
const Line2e = "--> `d` followed by any motion will delete to that destination"
29+
const Line3e = "--> This can allow for more precision when there aren't simple boundaries"
30+
const Line4e = "--> public void somethingsomething(arg1, arg2, extra1, extra2)"
31+
const Line4eCorrecta = "--> public void something(arg1, arg2, extra1, extra2)"
32+
const Line4eCorrectb = "--> public void something(arg1, arg2)"
2633

2734
export class DeleteOperatorTutorial implements ITutorial {
2835
private _stages: ITutorialStage[]
@@ -74,7 +81,31 @@ export class DeleteOperatorTutorial implements ITutorial {
7481
Stages.combine(
7582
"Delete the duplicate word with 'dw'",
7683
new Stages.DeleteCharactersStage(null, 3, 20, "duplicate"),
77-
new Stages.WaitForStateStage(null, [Line1, Line2d, Line3d, Line4dCorrect]),
84+
new Stages.WaitForStateStage(null, [Line1, Line2d, Line3d, Line4dCorrecta]),
85+
),
86+
Stages.combine(
87+
"Delete the word again with 'dw'",
88+
new Stages.DeleteCharactersStage(null, 3, 20, "duplicate"),
89+
new Stages.WaitForStateStage(null, [Line1, Line2d, Line3d, Line4dCorrectb]),
90+
),
91+
Stages.combine(
92+
null,
93+
new Stages.FadeInLineStage(null, 1, Line2e),
94+
new Stages.FadeInLineStage(null, 2, Line3e),
95+
new Stages.FadeInLineStage(null, 3, Line4e),
96+
new Stages.SetBufferStage([Line1, Line2e, Line3e, Line4e]),
97+
),
98+
new Stages.MoveToGoalStage("Move to the goal marker", 3, 16),
99+
Stages.combine(
100+
"Use 'dts' to delete to the next 's'",
101+
new Stages.DeleteCharactersStage(null, 3, 16, "something"),
102+
new Stages.WaitForStateStage(null, [Line1, Line2e, Line3e, Line4eCorrecta]),
103+
),
104+
new Stages.MoveToGoalStage("Move to the goal marker", 3, 36),
105+
Stages.combine(
106+
"Use 'dt)' to delete to the ')'",
107+
new Stages.DeleteCharactersStage(null, 3, 36, ", extra1, extra2"),
108+
new Stages.WaitForStateStage(null, [Line1, Line2e, Line3e, Line4eCorrectb]),
78109
),
79110
]
80111
}

browser/src/Services/Learning/Tutorial/Tutorials/InlineFindingTutorial.tsx

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,72 @@ export class InlineFindingTutorial implements ITutorial {
2323
constructor() {
2424
this._stages = [
2525
new Stages.SetBufferStage([Line1]),
26-
new Stages.MoveToGoalStage("Move to the 'n' in 'next' using 'fn'", 0, 23),
26+
new Stages.MoveToGoalStage("Move to the nearest 'n' using 'fn'", 0, 23),
27+
new Stages.MoveToGoalStage("Move to the nearest 'a' using 'fa'", 0, 42),
2728
new Stages.SetBufferStage([Line1, Line2]),
28-
new Stages.MoveToGoalStage("Use 'j' to move down a line", 1, 23),
29-
new Stages.MoveToGoalStage("Use 'F' to move LEFT to the goal", 1, 15),
29+
new Stages.MoveToGoalStage("Move down a line", 1, 42),
30+
new Stages.MoveToGoalStage("Use 'Fm' to move BACKWARDS to the nearest 'm'", 1, 15),
31+
new Stages.MoveToGoalStage("Use 'Fs' to move BACKWARDS to the nearest 's'", 1, 5),
3032
new Stages.SetBufferStage([Line1, Line2, Line3]),
31-
new Stages.MoveToGoalStage("Use 'j' to move down a line", 2, 15),
32-
new Stages.MoveToGoalStage("Move to the character before 'b' using 'tb'", 2, 43),
33+
new Stages.MoveToGoalStage("Move down a line", 2, 5),
34+
new Stages.MoveToGoalStage("Use 'tx' to move to the character before 'x'", 2, 16),
35+
new Stages.MoveToGoalStage("Use 'tb' to move to the character before 'b'", 2, 43),
3336
new Stages.SetBufferStage([Line1, Line2, Line3, Line4]),
34-
new Stages.MoveToGoalStage("Use 'j' to move down a line", 3, 43),
35-
new Stages.MoveToGoalStage("Use 'T' to move to the goal", 3, 12),
37+
new Stages.MoveToGoalStage("Move down a line", 3, 43),
38+
new Stages.MoveToGoalStage(
39+
"Use 'Tx' to move BACKWARDS to the character before 'x'",
40+
3,
41+
22,
42+
),
43+
new Stages.MoveToGoalStage(
44+
"Use 'Tl' to move BACKWARDS to the character before 'l'",
45+
3,
46+
12,
47+
),
3648
new Stages.SetBufferStage([Line1, Line2, Line3, Line4, Line5]),
37-
new Stages.MoveToGoalStage("Use 'j' to move down a line", 4, 12),
38-
new Stages.MoveToGoalStage("Use 'f' to move to the goal", 4, 24),
39-
new Stages.MoveToGoalStage("Use ';' to move to the goal", 4, 34),
40-
new Stages.MoveToGoalStage("Use ';' to move to the goal", 4, 36),
41-
new Stages.MoveToGoalStage("Use ';' to move to the goal", 4, 42),
49+
new Stages.MoveToGoalStage("Move down a line", 4, 12),
50+
new Stages.MoveToGoalStage("Use 'fe' to move to the nearest 'e'", 4, 24),
51+
new Stages.MoveToGoalStage("Use ';' to move to the next instance of 'e'", 4, 34),
52+
new Stages.MoveToGoalStage("Use ';' to move to the next instance of 'e'", 4, 36),
53+
new Stages.MoveToGoalStage("Use ';' to move to the next instance of 'e'", 4, 42),
4254
new Stages.SetBufferStage([Line1, Line2, Line3, Line4, Line5, Line6]),
43-
new Stages.MoveToGoalStage("Use 'j' to move down a line", 5, 42),
44-
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 24),
45-
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 18),
46-
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 16),
47-
new Stages.MoveToGoalStage("Use ',' to move to the goal", 5, 6),
55+
new Stages.MoveToGoalStage("Move down a line", 5, 42),
56+
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 24),
57+
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 18),
58+
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 16),
59+
new Stages.MoveToGoalStage("Use ',' to move to the previous instance of 'e'", 5, 6),
60+
new Stages.MoveToGoalStage("Move up a line", 4, 6),
61+
new Stages.MoveToGoalStage("Use 'te' to move before the nearest 'e'", 4, 23),
62+
new Stages.MoveToGoalStage("Use ';' to move before the next instance of 'e'", 4, 33),
63+
new Stages.MoveToGoalStage("Use ';' to move before the next instance of 'e'", 4, 35),
64+
new Stages.MoveToGoalStage("Use ';' to move before the next instance of 'e'", 4, 41),
65+
new Stages.SetBufferStage([Line1, Line2, Line3, Line4, Line5, Line6]),
66+
new Stages.MoveToGoalStage("Move down a line", 5, 41),
67+
new Stages.MoveToGoalStage(
68+
"Use ',' to move before the previous instance of 'e'",
69+
5,
70+
25,
71+
),
72+
new Stages.MoveToGoalStage(
73+
"Use ',' to move before the previous instance of 'e'",
74+
5,
75+
19,
76+
),
77+
new Stages.MoveToGoalStage(
78+
"Use ',' to move before the previous instance of 'e'",
79+
5,
80+
17,
81+
),
82+
new Stages.MoveToGoalStage("Use ',' to move before the previous instance of 'e'", 5, 7),
4883
]
4984
}
5085

5186
public get metadata(): ITutorialMetadata {
5287
return {
5388
id: "oni.tutorials.inline_finding",
54-
name: "Motion: f, F, t, T",
89+
name: "Character Find Motion: f, F, t, T",
5590
description:
56-
"Sometimes you need to move faster than 'h' and 'l' allow you to but need more control than 'w', 'e', and 'b', especially when using different operators. 'f' moves to a specific character to the right of the cursor, 'F' moves to a specific character to the left, and ';' and ',' allow you to repeat these motions in different directions.",
91+
"Sometimes you need to move faster than 'h' and 'l' allow but need more control than 'w', 'e', and 'b', especially when using the operators you'll learn later. 'f' followed by any character moves to the next instance of that character, 'F' followed by any character moves backwards to the next instance of that character. Similarly, 't' and 'T' move forwards and backwards up to (but not on) the specified character. After performing a 'f', 'F', 't', or 'T' operation ';' and ',' allow you to repeat those motions in different directions.",
5792
level: 145,
5893
}
5994
}

browser/src/Services/Learning/Tutorial/Tutorials/InsertAndUndoTutorial.tsx

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* InsertAndUndoTutorial.tsx
33
*
4-
* Tutorial that brings together moving and inserting
4+
* Tutorial for undo and redo before we learn destructive changes
55
*/
66

77
import * as React from "react"
@@ -64,15 +64,39 @@ export class InsertAndUndoTutorial implements ITutorial {
6464
"There is some text msing this .",
6565
TutorialLine1Correct,
6666
]),
67+
new Stages.WaitForStateStage("Press 'u' to undo yet another change", [
68+
"There is text msing this .",
69+
TutorialLine1Correct,
70+
]),
71+
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo the last undo", [
72+
"There is some text msing this .",
73+
TutorialLine1Correct,
74+
]),
75+
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo the next undo", [
76+
"There is some text missing this .",
77+
TutorialLine1Correct,
78+
]),
79+
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo yet another undo", [
80+
"There is some text missing from this .",
81+
TutorialLine1Correct,
82+
]),
83+
new Stages.WaitForStateStage("Press 'Ctrl+r' to redo yet another undo", [
84+
"There is some text missing from this line.",
85+
TutorialLine1Correct,
86+
]),
87+
new Stages.WaitForStateStage("Press 'u' to undo the last change", [
88+
"There is some text missing from this .",
89+
TutorialLine1Correct,
90+
]),
6791
]
6892
}
6993

7094
public get metadata(): ITutorialMetadata {
7195
return {
72-
id: "oni.tutorial.insert_and_undo",
73-
name: "Insert and Undo",
96+
id: "oni.tutorial.undo_and_redo",
97+
name: "Undo and Redo",
7498
description:
75-
"It's important to be able to switch between normal and insert mode, in order to edit text! Let's put together the cursor motion and insert mode from the previous tutorials. If you make any mistakes, you can undo inserted text with 'u'.",
99+
"It's important to be able to switch between normal and insert mode, in order to edit text! Let's put together the cursor motion and insert mode from the previous tutorials. If you make any mistakes, you can undo inserted text with 'u'. To bring back an undo, hit 'Ctrl+r' to redo.",
76100
level: 170,
77101
}
78102
}
@@ -82,6 +106,12 @@ export class InsertAndUndoTutorial implements ITutorial {
82106
}
83107

84108
public get notes(): JSX.Element[] {
85-
return [<Notes.HJKLKeys />, <Notes.IKey />, <Notes.EscKey />, <Notes.UKey />]
109+
return [
110+
<Notes.HJKLKeys />,
111+
<Notes.IKey />,
112+
<Notes.EscKey />,
113+
<Notes.UKey />,
114+
<Notes.RedoKey />,
115+
]
86116
}
87117
}

browser/src/Services/Learning/Tutorial/Tutorials/SearchInBufferTutorial.tsx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const Line7 = "The '?' key will let you search backwards instead!"
2525
const Line8 = "'?' searches backward, the 'n' and 'N' keys operate backward as well!"
2626
const Line9 = "'N' will move you to the next instance going down"
2727
const Line10 = "'n' will move you to the next instance going up"
28+
const Line11 = "It may take you some practice to use reverse search"
2829

2930
export class SearchInBufferTutorial implements ITutorial {
3031
private _stages: ITutorialStage[]
@@ -55,28 +56,41 @@ export class SearchInBufferTutorial implements ITutorial {
5556
new Stages.MoveToGoalStage("Use 'N' to go to the previous instance of 'move'", 2, 21),
5657
new Stages.MoveToGoalStage("Use 'N' to go to the previous instance of 'move'", 1, 28),
5758
// Backward search
58-
new Stages.SetBufferStage([Line7]),
59-
new Stages.SetCursorPositionStage(0, 48),
60-
new Stages.MoveToGoalStage("Use '?' to search backwards for the word 'you'", 0, 21),
61-
new Stages.SetBufferStage([Line7, Line8, Line9]),
59+
new Stages.SetBufferStage([Line7, Line8, Line9, Line10, Line11]),
60+
new Stages.SetCursorPositionStage(4, 33),
61+
new Stages.MoveToGoalStage("Use '?' to search backwards for the word 'you'", 4, 12),
6262
new Stages.MoveToGoalStage(
63-
"Use 'N' to go to the previous (backwards) instance of 'you'",
63+
"Use 'n' to go to the next (backwards) instance of 'you'",
64+
3,
65+
14,
66+
),
67+
new Stages.MoveToGoalStage(
68+
"Use 'n' to go to the next (backwards) instance of 'you'",
6469
2,
6570
14,
6671
),
67-
new Stages.SetBufferStage([Line7, Line8, Line9, Line10]),
6872
new Stages.MoveToGoalStage(
69-
"Use 'n' to go to the next (backwards) instance of 'move'",
73+
"Use 'n' to go to the next (backwards) instance of 'you'",
7074
0,
7175
21,
7276
),
77+
new Stages.MoveToGoalStage(
78+
"Use 'N' to go to the previous (backwards) instance of 'you'",
79+
2,
80+
14,
81+
),
82+
new Stages.MoveToGoalStage(
83+
"Use 'N' to go to the previous (backwards) instance of 'you'",
84+
3,
85+
14,
86+
),
7387
]
7488
}
7589

7690
public get metadata(): ITutorialMetadata {
7791
return {
7892
id: "oni.tutorials.find_across_buffer",
79-
name: "Motion: /, ?, n, N",
93+
name: "Search Motion: /, ?, n, N",
8094
description:
8195
"To navigate a buffer efficiently, Oni lets you search for strings with `/` and `?`. `n` and `N` let you navigate quickly between the matches!",
8296
level: 160,

0 commit comments

Comments
 (0)