{"schemaVersion":1,"contentVersion":"3.4.0","id":"intermediate.9","languages":{"javascript":{"id":"intermediate.9","title":"Leave and return deliberately","moduleName":"Boundaries and reusable text","tips":"","concept":"<p class=\"lead\">Go somewhere else in the file and come back, using the jump list or a mark.</p><p><strong>Before this lesson:</strong> Buffer destinations.</p><p>Vim remembers big jumps such as G, a search or * in the jump list. Ctrl-o goes back to where you were and Ctrl-i goes forward again. ma sets a mark called a, and a backtick followed by a brings you back to that exact column. When a task asks you to come back, you have to make the trip out first.</p><h3>Example</h3><p>From a note near the top, G takes you to the end and Ctrl-o brings you back. ma, G, then backtick-a does the same with a mark you set yourself.</p><p>Use Start over to try again.</p>","teaches":["jump-list"],"introduces":["G","gg","<C-o>","<C-i>","m","`"],"constraints":[],"drills":[{"task":"The drawer should show the same note as checkout. Copy checkout's translation key into the empty <code>t(\"\")</code>.","hint":"2* jumps to the second t after this one. A search is a jump, so Ctrl-o brings you back to the same spot.","mode":"jsx","start":"// Notes in the cart drawer and at checkout. The texts come from the translations.\nimport { t } from \"../i18n\";\nimport { Note } from \"../ui/Note\";\n\nexport function DrawerNotes() {\n  return <div className=\"drawer-notes\"><Note tone=\"info\" text={t(\"\")} /></div>;\n}\n\nexport function CheckoutNotes({ order }) {\n  const title = t(\"checkout.notes_title\");\n  const tone = order.placedAt.getMonth() === 11 ? \"warning\" : \"info\";\n  return <Note tone={tone} title={title} text={t(\"checkout.free_shipping_over_50\")} />;\n}\n\nexport default DrawerNotes;","startCursor":{"line":5,"ch":63},"paths":[{"keys":["2","*","y","i","\"","<C-o>","f","\"","p"],"tier":"idiomatic","technique":"jump-list:<C-o>","core":["jump-list:<C-o>","jump-list","search:*"],"note":"Ctrl-o goes back to the t you left, past the t in between, so you don't have to find the line and the column again."}],"target":"// Notes in the cart drawer and at checkout. The texts come from the translations.\nimport { t } from \"../i18n\";\nimport { Note } from \"../ui/Note\";\n\nexport function DrawerNotes() {\n  return <div className=\"drawer-notes\"><Note tone=\"info\" text={t(\"checkout.free_shipping_over_50\")} /></div>;\n}\n\nexport function CheckoutNotes({ order }) {\n  const title = t(\"checkout.notes_title\");\n  const tone = order.placedAt.getMonth() === 11 ? \"warning\" : \"info\";\n  return <Note tone={tone} title={title} text={t(\"checkout.free_shipping_over_50\")} />;\n}\n\nexport default DrawerNotes;","language":"javascript","evidence":"guided","canonicalKey":"intermediate.9#0","canonicalFingerprint":"xkq3v5"}]},"python":{"id":"intermediate.9","title":"Leave and return deliberately","moduleName":"Boundaries and reusable text","tips":"","concept":"<p class=\"lead\">Go somewhere else in the file and come back, using the jump list or a mark.</p><p><strong>Before this lesson:</strong> Buffer destinations.</p><p>Vim remembers big jumps such as G, a search or * in the jump list. Ctrl-o goes back to where you were and Ctrl-i goes forward again. ma sets a mark called a, and a backtick followed by a brings you back to that exact column. When a task asks you to come back, you have to make the trip out first.</p><h3>Example</h3><p>From a note near the top, G takes you to the end and Ctrl-o brings you back. ma, G, then backtick-a does the same with a mark you set yourself.</p><p>Use Start over to try again.</p>","teaches":["jump-list"],"introduces":["G","gg","<C-o>","<C-i>","m","`"],"constraints":[],"drills":[{"task":"The drawer's free shipping line should say what the shipping note says. Copy that text into it.","hint":"G is a jump, so Ctrl-o brings you back to where you were, to the same column.","mode":"python","start":"\"\"\"Messages for the cart drawer. Missing translations fall back to English.\"\"\"\n\nMESSAGES = {\n    \"empty\": \"Your cart is empty.\",\n    \"free_shipping\": \"\",\n    \"go_to_checkout\": \"Continue to checkout\",\n    \"remove_item\": \"Take out of cart\",\n    \"quantity_label\": \"How many\",\n    \"shipping_note\": \"Free shipping on orders over 50 euros.\",\n}","startCursor":{"line":4,"ch":21},"paths":[{"keys":["G","k","2","W","y","i","\"","<C-o>","p"],"tier":"idiomatic","technique":"jump-list:<C-o>","core":["jump-list:<C-o>","jump-list"],"note":"Ctrl-o goes back to where you were before G, so you don't have to find the line again."}],"target":"\"\"\"Messages for the cart drawer. Missing translations fall back to English.\"\"\"\n\nMESSAGES = {\n    \"empty\": \"Your cart is empty.\",\n    \"free_shipping\": \"Free shipping on orders over 50 euros.\",\n    \"go_to_checkout\": \"Continue to checkout\",\n    \"remove_item\": \"Take out of cart\",\n    \"quantity_label\": \"How many\",\n    \"shipping_note\": \"Free shipping on orders over 50 euros.\",\n}","language":"python","evidence":"guided","canonicalKey":"intermediate.9#0","canonicalFingerprint":"xkq3v5"}]},"text":{"id":"intermediate.9","title":"Leave and return deliberately","moduleName":"Boundaries and reusable text","tips":"","concept":"<p class=\"lead\">Go somewhere else in the file and come back, using the jump list or a mark.</p><p><strong>Before this lesson:</strong> Buffer destinations.</p><p>Vim remembers big jumps such as G, a search or * in the jump list. Ctrl-o goes back to where you were and Ctrl-i goes forward again. ma sets a mark called a, and a backtick followed by a brings you back to that exact column. When a task asks you to come back, you have to make the trip out first.</p><h3>Example</h3><p>From a note near the top, G takes you to the end and Ctrl-o brings you back. ma, G, then backtick-a does the same with a mark you set yourself.</p><p>Use Start over to try again.</p>","teaches":["jump-list"],"introduces":["G","gg","<C-o>","<C-i>","m","`"],"constraints":[],"drills":[{"task":"The email for a shipped order has no subject. Give it the subject of the late one: copy it into the empty string.","hint":"2* jumps to the second subject below. A search is a jump, so Ctrl-o brings you back to the same spot, and W gets you to the quotes.","mode":"text/plain","start":"# What we send for each order event. An empty subject falls back to the event name.\norder_shipped:\n  email: {template: \"order-shipped\", subject: \"\"}\n  sms: {template: \"order-shipped-sms\"}\norder_delivered:\n  email: {template: \"order-delivered\", subject: \"Your parcel has arrived\"}\n  sms: {template: \"order-delivered-sms\"}\norder_returned:\n  email: {template: \"order-returned\"}\n  sms: {template: \"order-returned-sms\"}\norder_shipped_late:\n  email: {subject: \"Your parcel is on its way\", template: \"order-shipped-late\"}\n  sms: {template: \"order-shipped-late-sms\"}\norder_cancelled:\n  email: {template: \"order-cancelled\"}","startCursor":{"line":2,"ch":43},"paths":[{"keys":["2","*","y","i","\"","<C-o>","W","p"],"tier":"idiomatic","technique":"jump-list:<C-o>","core":["jump-list:<C-o>","jump-list","search:*"],"note":"Ctrl-o goes back to where 2* started, so you don't have to find the line and the column again."}],"target":"# What we send for each order event. An empty subject falls back to the event name.\norder_shipped:\n  email: {template: \"order-shipped\", subject: \"Your parcel is on its way\"}\n  sms: {template: \"order-shipped-sms\"}\norder_delivered:\n  email: {template: \"order-delivered\", subject: \"Your parcel has arrived\"}\n  sms: {template: \"order-delivered-sms\"}\norder_returned:\n  email: {template: \"order-returned\"}\n  sms: {template: \"order-returned-sms\"}\norder_shipped_late:\n  email: {subject: \"Your parcel is on its way\", template: \"order-shipped-late\"}\n  sms: {template: \"order-shipped-late-sms\"}\norder_cancelled:\n  email: {template: \"order-cancelled\"}","language":"text","evidence":"guided","canonicalKey":"intermediate.9#0","canonicalFingerprint":"xkq3v5"}]}},"concepts":{"javascript":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Buffer destinations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Go somewhere else in the file and come back, using the jump list or a mark.</p><p>Vim remembers big jumps such as G, a search or * in the jump list. Ctrl-o goes back to where you were and Ctrl-i goes forward again. ma sets a mark called a, and a backtick followed by a brings you back to that exact column. When a task asks you to come back, you have to make the trip out first.</p><h2 class=\"prose-subhead\">Example</h2><p>From a note near the top, G takes you to the end and Ctrl-o brings you back. ma, G, then backtick-a does the same with a mark you set yourself.</p><p>Use Start over to try again.</p></div></details>"},"python":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Buffer destinations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Go somewhere else in the file and come back, using the jump list or a mark.</p><p>Vim remembers big jumps such as G, a search or * in the jump list. Ctrl-o goes back to where you were and Ctrl-i goes forward again. ma sets a mark called a, and a backtick followed by a brings you back to that exact column. When a task asks you to come back, you have to make the trip out first.</p><h2 class=\"prose-subhead\">Example</h2><p>From a note near the top, G takes you to the end and Ctrl-o brings you back. ma, G, then backtick-a does the same with a mark you set yourself.</p><p>Use Start over to try again.</p></div></details>"},"text":{"lead":"","reminder":"<p class=\"lesson-prereq\"><strong>Before this lesson:</strong> Buffer destinations.</p>","more":"<details class=\"lesson-more\"><summary>More about this lesson</summary><div class=\"lesson-more-body prose\"><p class=\"lead\">Go somewhere else in the file and come back, using the jump list or a mark.</p><p>Vim remembers big jumps such as G, a search or * in the jump list. Ctrl-o goes back to where you were and Ctrl-i goes forward again. ma sets a mark called a, and a backtick followed by a brings you back to that exact column. When a task asks you to come back, you have to make the trip out first.</p><h2 class=\"prose-subhead\">Example</h2><p>From a note near the top, G takes you to the end and Ctrl-o brings you back. ma, G, then backtick-a does the same with a mark you set yourself.</p><p>Use Start over to try again.</p></div></details>"}}}