From a3427fa4cc2468d1aa5a6b95d0d8ccda0a9f05b0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 09:54:27 -0700 Subject: [PATCH 01/72] Setup docs tab --- .github | 2 ++ docs/intro.md | 1 + {docs => notes}/file-modification | 0 {docs => test/flexbox}/flexbox-test-2.html | 0 {docs => test/flexbox}/flexbox-test-old.html | 0 {docs => test/flexbox}/flexbox-test.html | 0 6 files changed, 3 insertions(+) create mode 100644 .github create mode 100644 docs/intro.md rename {docs => notes}/file-modification (100%) rename {docs => test/flexbox}/flexbox-test-2.html (100%) rename {docs => test/flexbox}/flexbox-test-old.html (100%) rename {docs => test/flexbox}/flexbox-test.html (100%) diff --git a/.github b/.github new file mode 100644 index 000000000..fc652aa74 --- /dev/null +++ b/.github @@ -0,0 +1,2 @@ +[docs] + title = The Guide to Atom diff --git a/docs/intro.md b/docs/intro.md new file mode 100644 index 000000000..5643c235a --- /dev/null +++ b/docs/intro.md @@ -0,0 +1 @@ +Welcome to the Atom guide diff --git a/docs/file-modification b/notes/file-modification similarity index 100% rename from docs/file-modification rename to notes/file-modification diff --git a/docs/flexbox-test-2.html b/test/flexbox/flexbox-test-2.html similarity index 100% rename from docs/flexbox-test-2.html rename to test/flexbox/flexbox-test-2.html diff --git a/docs/flexbox-test-old.html b/test/flexbox/flexbox-test-old.html similarity index 100% rename from docs/flexbox-test-old.html rename to test/flexbox/flexbox-test-old.html diff --git a/docs/flexbox-test.html b/test/flexbox/flexbox-test.html similarity index 100% rename from docs/flexbox-test.html rename to test/flexbox/flexbox-test.html From 599c2293d6bc0076e96d6355bfcc6ca009e18b48 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 10:07:23 -0700 Subject: [PATCH 02/72] Add content from wiki to docs/ --- docs/kyles-little-things.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/kyles-little-things.md diff --git a/docs/kyles-little-things.md b/docs/kyles-little-things.md new file mode 100644 index 000000000..b888df3a1 --- /dev/null +++ b/docs/kyles-little-things.md @@ -0,0 +1,5 @@ +I recently switched over to Sublime Text 2 and for the most part it's been pretty awesome. But I've been noticing a lot of little things that I really appreciate in an editor, so I thought I'd note them down. + +1. Indenting soft-wrapped lines http://share.kyleneath.com/captures/_upsell.html.erb-20120127-231402.png +2. Respecting Chrome-like tab behavior (drag between windows/panes, `⌘+Shift+T` to get last closed tab back, `⌘+N` for a new tab in your current pane) +3. Indent markers http://share.kyleneath.com/captures/billing_dependency.rb-20120127-232754.png From 99fb8a33db53866bbf0d6e67a6b9c501c7b463da Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 10:09:47 -0700 Subject: [PATCH 03/72] Add titles --- docs/intro.md | 2 +- docs/kyles-little-things.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/intro.md b/docs/intro.md index 5643c235a..817069919 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1 +1 @@ -Welcome to the Atom guide +# Welcome to the Atom guide diff --git a/docs/kyles-little-things.md b/docs/kyles-little-things.md index b888df3a1..2f8f21efd 100644 --- a/docs/kyles-little-things.md +++ b/docs/kyles-little-things.md @@ -1,3 +1,4 @@ +## The Little Things™ I recently switched over to Sublime Text 2 and for the most part it's been pretty awesome. But I've been noticing a lot of little things that I really appreciate in an editor, so I thought I'd note them down. 1. Indenting soft-wrapped lines http://share.kyleneath.com/captures/_upsell.html.erb-20120127-231402.png From c089fc20746b7d6aa06e0483550c702899e5c222 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 10:11:12 -0700 Subject: [PATCH 04/72] Use ## for intro heading --- docs/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/intro.md b/docs/intro.md index 817069919..4b2fec264 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1 +1 @@ -# Welcome to the Atom guide +## Welcome to the Atom guide From 7ce292af616fa73470e2287dc605d12450be4c20 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 10:48:26 -0700 Subject: [PATCH 05/72] Add docs for wrap-guide extension --- docs/intro.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/intro.md b/docs/intro.md index 4b2fec264..feec3c2e4 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1 +1,35 @@ ## Welcome to the Atom guide + +## Extensions + +### Wrap Guide + +The wrap-guide extension places a vertical line in each editor at a certain +column to guide your formatting so lines do not exceed a certain width. + +By default the wrap-guide is placed at the 80th column. + +#### Configuration + +You can configure where this column is on a per-path basis using the following +configuration data options: + +```coffeescript +wrapGuideConfig = + getGuideColumn: (path, defaultColumn) -> + if path.indexOf('.mm', path.length - 3) isnt -1 + return -1 # Disable the guide for Objective-C files + else + return defaultColumn +requireExtension 'wrap-guide', wrapGuideConfig +``` + +You can configure the color of the line by adding the following CSS to a custom +stylesheet: + +```css +.wrap-guide { + width: 10px; + background-color: red; +} +``` From 4a04fabe9bdf579c6f15061405bd75c8aff3908f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 10:50:14 -0700 Subject: [PATCH 06/72] Add h3 and h4 styles to markdown preview stylesheet --- static/markdown-preview.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/static/markdown-preview.css b/static/markdown-preview.css index da83bb5a5..6c1c7265a 100644 --- a/static/markdown-preview.css +++ b/static/markdown-preview.css @@ -65,6 +65,20 @@ border-bottom: 1px solid #CCC; } +.markdown-body h3 { + font-size: 18px; + font-weight: bold; + margin-top: 20px; + margin-bottom: 10px; +} + +.markdown-body h4 { + font-size: 16px; + font-weight: bold; + margin-top: 20px; + margin-bottom: 10px; +} + .markdown-body p { margin-bottom: 15px; } From ddf4b55ee8139a4fa9bb281419c81e1be736cd81 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 10:55:33 -0700 Subject: [PATCH 07/72] Mention configuring width --- docs/intro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/intro.md b/docs/intro.md index feec3c2e4..f81f7d5f9 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -24,8 +24,8 @@ wrapGuideConfig = requireExtension 'wrap-guide', wrapGuideConfig ``` -You can configure the color of the line by adding the following CSS to a custom -stylesheet: +You can configure the color and/or width of the line by adding the following +CSS to a custom stylesheet: ```css .wrap-guide { From 39530535b98894bfc4552119c9ea7ee415913483 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 10:57:04 -0700 Subject: [PATCH 08/72] Put positive case in if statement --- docs/intro.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/intro.md b/docs/intro.md index f81f7d5f9..419a90813 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -17,10 +17,10 @@ configuration data options: ```coffeescript wrapGuideConfig = getGuideColumn: (path, defaultColumn) -> - if path.indexOf('.mm', path.length - 3) isnt -1 - return -1 # Disable the guide for Objective-C files - else + if path.indexOf('.mm', path.length - 3) is -1 return defaultColumn + else + return -1 # Disable the guide for Objective-C files requireExtension 'wrap-guide', wrapGuideConfig ``` From 430f03f8e464a3b6b0774b922334e47aac728a7e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 15:00:45 -0700 Subject: [PATCH 09/72] Move old wiki page to notes folder --- {docs => notes}/kyles-little-things.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {docs => notes}/kyles-little-things.md (100%) diff --git a/docs/kyles-little-things.md b/notes/kyles-little-things.md similarity index 100% rename from docs/kyles-little-things.md rename to notes/kyles-little-things.md From 7763ca3d4c257379a3fc9a20cefe2aa553d60f8a Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sun, 30 Sep 2012 15:01:27 -0700 Subject: [PATCH 10/72] Be definitive --- docs/intro.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/intro.md b/docs/intro.md index 419a90813..0c0ff5f60 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1,4 +1,6 @@ -## Welcome to the Atom guide +## The Definitive Guide to Atom + +Welcome! ## Extensions From 2dea1280e29c3f23df4bc5526a6c24ba00a71398 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 1 Oct 2012 10:27:50 -0700 Subject: [PATCH 11/72] Create sub-folder for extension docs --- .github | 1 + docs/extensions/intro.md | 1 + docs/extensions/wrap-guide.md | 31 +++++++++++++++++++++++++++++++ docs/intro.md | 34 ---------------------------------- 4 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 docs/extensions/intro.md create mode 100644 docs/extensions/wrap-guide.md diff --git a/.github b/.github index fc652aa74..cee867e81 100644 --- a/.github +++ b/.github @@ -1,2 +1,3 @@ [docs] title = The Guide to Atom + manifest = intro.md, extensions/intro.md, extension/wrap-guide.md diff --git a/docs/extensions/intro.md b/docs/extensions/intro.md new file mode 100644 index 000000000..01c1c040e --- /dev/null +++ b/docs/extensions/intro.md @@ -0,0 +1 @@ +## Extensions diff --git a/docs/extensions/wrap-guide.md b/docs/extensions/wrap-guide.md new file mode 100644 index 000000000..5502f47fe --- /dev/null +++ b/docs/extensions/wrap-guide.md @@ -0,0 +1,31 @@ +### Wrap Guide + +The wrap-guide extension places a vertical line in each editor at a certain +column to guide your formatting so lines do not exceed a certain width. + +By default the wrap-guide is placed at the 80th column. + +#### Configuration + +You can configure where this column is on a per-path basis using the following +configuration data options: + +```coffeescript +wrapGuideConfig = + getGuideColumn: (path, defaultColumn) -> + if path.indexOf('.mm', path.length - 3) is -1 + return defaultColumn + else + return -1 # Disable the guide for Objective-C files +requireExtension 'wrap-guide', wrapGuideConfig +``` + +You can configure the color and/or width of the line by adding the following +CSS to a custom stylesheet: + +```css +.wrap-guide { + width: 10px; + background-color: red; +} +``` diff --git a/docs/intro.md b/docs/intro.md index 0c0ff5f60..402cf5a27 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -1,37 +1,3 @@ ## The Definitive Guide to Atom Welcome! - -## Extensions - -### Wrap Guide - -The wrap-guide extension places a vertical line in each editor at a certain -column to guide your formatting so lines do not exceed a certain width. - -By default the wrap-guide is placed at the 80th column. - -#### Configuration - -You can configure where this column is on a per-path basis using the following -configuration data options: - -```coffeescript -wrapGuideConfig = - getGuideColumn: (path, defaultColumn) -> - if path.indexOf('.mm', path.length - 3) is -1 - return defaultColumn - else - return -1 # Disable the guide for Objective-C files -requireExtension 'wrap-guide', wrapGuideConfig -``` - -You can configure the color and/or width of the line by adding the following -CSS to a custom stylesheet: - -```css -.wrap-guide { - width: 10px; - background-color: red; -} -``` From 14ba8f712e4f2dc6882cc0208b39e0e9f4ae9347 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 1 Oct 2012 10:30:53 -0700 Subject: [PATCH 12/72] Update folder name of wrap-guide doc --- .github | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github b/.github index cee867e81..e54ea7f6d 100644 --- a/.github +++ b/.github @@ -1,3 +1,3 @@ [docs] title = The Guide to Atom - manifest = intro.md, extensions/intro.md, extension/wrap-guide.md + manifest = intro.md, extensions/intro.md, extensions/wrap-guide.md From 4deb1f229043a72d06dce9c2350d9f78c28eb326 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 1 Oct 2012 10:34:59 -0700 Subject: [PATCH 13/72] Add initial markdown preview docs --- .github | 2 +- docs/extensions/markdown-preview.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 docs/extensions/markdown-preview.md diff --git a/.github b/.github index e54ea7f6d..900b87d40 100644 --- a/.github +++ b/.github @@ -1,3 +1,3 @@ [docs] title = The Guide to Atom - manifest = intro.md, extensions/intro.md, extensions/wrap-guide.md + manifest = intro.md, extensions/intro.md, extensions/markdown-preview.md, extensions/wrap-guide.md diff --git a/docs/extensions/markdown-preview.md b/docs/extensions/markdown-preview.md new file mode 100644 index 000000000..36146bf97 --- /dev/null +++ b/docs/extensions/markdown-preview.md @@ -0,0 +1,7 @@ +### Markdown Preview + +The markdown-preview extension displays the rendered HTML for the markdown +in the current editor. + +It can be activated from the editor using the `meta-P` key-binding and is +currently enabled for `.md` and `.markdown` files. From 83fc9cd7c5e50569527b4e5a1231d8f08eb347b8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 1 Oct 2012 10:40:59 -0700 Subject: [PATCH 14/72] Monospace extension names --- docs/extensions/markdown-preview.md | 2 +- docs/extensions/wrap-guide.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/extensions/markdown-preview.md b/docs/extensions/markdown-preview.md index 36146bf97..2de97fedc 100644 --- a/docs/extensions/markdown-preview.md +++ b/docs/extensions/markdown-preview.md @@ -1,6 +1,6 @@ ### Markdown Preview -The markdown-preview extension displays the rendered HTML for the markdown +The `markdown-preview` extension displays the rendered HTML for the markdown in the current editor. It can be activated from the editor using the `meta-P` key-binding and is diff --git a/docs/extensions/wrap-guide.md b/docs/extensions/wrap-guide.md index 5502f47fe..1a26be703 100644 --- a/docs/extensions/wrap-guide.md +++ b/docs/extensions/wrap-guide.md @@ -1,6 +1,6 @@ ### Wrap Guide -The wrap-guide extension places a vertical line in each editor at a certain +The `wrap-guide` extension places a vertical line in each editor at a certain column to guide your formatting so lines do not exceed a certain width. By default the wrap-guide is placed at the 80th column. From 6d151809c328de4020ca7c0ab3d34669826c635a Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 1 Oct 2012 11:50:33 -1000 Subject: [PATCH 15/72] Delete these old flexbox tests now that we don't really care about flexbox --- test/flexbox/flexbox-test-2.html | 64 ----------------------- test/flexbox/flexbox-test-old.html | 84 ------------------------------ test/flexbox/flexbox-test.html | 53 ------------------- 3 files changed, 201 deletions(-) delete mode 100644 test/flexbox/flexbox-test-2.html delete mode 100644 test/flexbox/flexbox-test-old.html delete mode 100644 test/flexbox/flexbox-test.html diff --git a/test/flexbox/flexbox-test-2.html b/test/flexbox/flexbox-test-2.html deleted file mode 100644 index 482f2e6e9..000000000 --- a/test/flexbox/flexbox-test-2.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - -
-
-
- My cross size (height) should be equal to the height of my flexbox container. I should overflow, because my height should be too short to contain all my content. -
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
-
-
- My cross size (height) should also be equal to the height of my flexbox container, but I don't overflow. -
-
- - - - diff --git a/test/flexbox/flexbox-test-old.html b/test/flexbox/flexbox-test-old.html deleted file mode 100644 index 683c44842..000000000 --- a/test/flexbox/flexbox-test-old.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - wtf - - - - -
-
Keffiyeh mustache pickled post-ironic, lomo vegan food truck helvetica direct trade nostrud. Assumenda odio brunch, DIY non anim delectus sunt aliqua organic VHS nihil pork belly accusamus. Bushwick vice high life tumblr mumblecore ullamco. High life pop-up lomo, pariatur exercitation odio helvetica food truck ex williamsburg stumptown hoodie ea polaroid jean shorts. Keytar sed sapiente, mumblecore fixie +1 cred occaecat accusamus. Fanny pack authentic dolor, id four loko dolore ex +1 pop-up. Thundercats cliche aliqua, fugiat irony marfa chambray banksy kogi organic selvage VHS DIY. Id mumblecore nisi, brunch narwhal nostrud vegan squid before they sold out. Sriracha laborum nesciunt, in salvia you probably haven't heard of them mustache VHS commodo squid proident williamsburg. Magna vero gentrify labore, non american apparel occaecat put a bird on it mlkshk DIY occupy eu pinterest aute cliche. Nihil delectus commodo voluptate nostrud. Tattooed tempor skateboard, sed tumblr nostrud chambray put a bird on it non salvia helvetica consectetur mcsweeney's incididunt. Est semiotics ut yr, fanny pack leggings voluptate carles. Ea odd future hoodie cred. Ex small batch wayfarers sartorial. Delectus mumblecore skateboard, kogi esse keytar vinyl sriracha before they sold out typewriter marfa odd future viral mollit. Polaroid biodiesel street art viral cupidatat art party, post-ironic minim. Irony qui reprehenderit, put a bird on it eiusmod iphone labore skateboard. Craft beer keffiyeh echo park, 3 wolf moon thundercats gentrify dolor beard VHS ullamco cillum post-ironic qui chambray. Sartorial cred ex, aliqua trust fund est consectetur put a bird on it in nisi cupidatat sapiente art party freegan. Mlkshk authentic velit laborum. Est tattooed hella pickled qui flexitarian. Mustache wes anderson food truck, cardigan selvage organic wayfarers VHS irure typewriter irony. Kale chips pitchfork four loko before they sold out. Quis blog proident jean shorts voluptate, photo booth high life post-ironic odio hella whatever. Vinyl 3 wolf moon qui, officia non artisan et helvetica cosby sweater velit street art proident quinoa reprehenderit. Odd future fap put a bird on it laboris, kale chips tempor duis velit. Voluptate mlkshk brooklyn nihil. Hoodie sustainable excepteur next level. Anim qui aliqua officia keffiyeh semiotics. Est brooklyn pop-up photo booth, jean shorts banksy mumblecore. Consequat typewriter ennui put a bird on it odio. Reprehenderit narwhal master cleanse, messenger bag sed wayfarers vinyl adipisicing ex nesciunt. Mollit carles ethnic craft beer shoreditch, incididunt veniam laboris small batch authentic dreamcatcher proident you probably haven't heard of them seitan. Id art party narwhal assumenda farm-to-table brooklyn. Seitan artisan adipisicing put a bird on it aute lomo. Next level letterpress pitchfork, master cleanse Austin small batch scenester mlkshk trust fund hella accusamus laboris iphone lo-fi. Minim consectetur fanny pack occupy, lo-fi twee cupidatat nostrud laborum sint. Master cleanse consectetur excepteur enim food truck banksy. Qui nisi truffaut helvetica excepteur. Quinoa banksy non four loko tattooed keffiyeh pickled, ex semiotics quis odd future consectetur flexitarian. Quis readymade 8-bit nisi.
-
-
Keffiyeh mustache pickled post-ironic, lomo vegan food truck helvetica direct trade nostrud. Assumenda odio brunch, DIY non anim delectus sunt aliqua organic VHS nihil pork belly accusamus. Bushwick vice high life tumblr mumblecore ullamco. High life pop-up lomo, pariatur exercitation odio helvetica food truck ex williamsburg stumptown hoodie ea polaroid jean shorts. Keytar sed sapiente, mumblecore fixie +1 cred occaecat accusamus. Fanny pack authentic dolor, id four loko dolore ex +1 pop-up. Thundercats cliche aliqua, fugiat irony marfa chambray banksy kogi organic selvage VHS DIY. Id mumblecore nisi, brunch narwhal nostrud vegan squid before they sold out. Sriracha laborum nesciunt, in salvia you probably haven't heard of them mustache VHS commodo squid proident williamsburg. Magna vero gentrify labore, non american apparel occaecat put a bird on it mlkshk DIY occupy eu pinterest aute cliche. Nihil delectus commodo voluptate nostrud. Tattooed tempor skateboard, sed tumblr nostrud chambray put a bird on it non salvia helvetica consectetur mcsweeney's incididunt. Est semiotics ut yr, fanny pack leggings voluptate carles. Ea odd future hoodie cred. Ex small batch wayfarers sartorial. Delectus mumblecore skateboard, kogi esse keytar vinyl sriracha before they sold out typewriter marfa odd future viral mollit. Polaroid biodiesel street art viral cupidatat art party, post-ironic minim. Irony qui reprehenderit, put a bird on it eiusmod iphone labore skateboard. Craft beer keffiyeh echo park, 3 wolf moon thundercats gentrify dolor beard VHS ullamco cillum post-ironic qui chambray. Sartorial cred ex, aliqua trust fund est consectetur put a bird on it in nisi cupidatat sapiente art party freegan. Mlkshk authentic velit laborum. Est tattooed hella pickled qui flexitarian. Mustache wes anderson food truck, cardigan selvage organic wayfarers VHS irure typewriter irony. Kale chips pitchfork four loko before they sold out. Quis blog proident jean shorts voluptate, photo booth high life post-ironic odio hella whatever. Vinyl 3 wolf moon qui, officia non artisan et helvetica cosby sweater velit street art proident quinoa reprehenderit. Odd future fap put a bird on it laboris, kale chips tempor duis velit. Voluptate mlkshk brooklyn nihil. Hoodie sustainable excepteur next level. Anim qui aliqua officia keffiyeh semiotics. Est brooklyn pop-up photo booth, jean shorts banksy mumblecore. Consequat typewriter ennui put a bird on it odio. Reprehenderit narwhal master cleanse, messenger bag sed wayfarers vinyl adipisicing ex nesciunt. Mollit carles ethnic craft beer shoreditch, incididunt veniam laboris small batch authentic dreamcatcher proident you probably haven't heard of them seitan. Id art party narwhal assumenda farm-to-table brooklyn. Seitan artisan adipisicing put a bird on it aute lomo. Next level letterpress pitchfork, master cleanse Austin small batch scenester mlkshk trust fund hella accusamus laboris iphone lo-fi. Minim consectetur fanny pack occupy, lo-fi twee cupidatat nostrud laborum sint. Master cleanse consectetur excepteur enim food truck banksy. Qui nisi truffaut helvetica excepteur. Quinoa banksy non four loko tattooed keffiyeh pickled, ex semiotics quis odd future consectetur flexitarian. Quis readymade 8-bit nisi.
-
-
- I am a child of a flexbox item. My height should be exactly the height of my container. -
-
-
Keffiyeh mustache pickled post-ironic, lomo vegan food truck helvetica direct trade nostrud. Assumenda odio brunch, DIY non anim delectus sunt aliqua organic VHS nihil pork belly accusamus. Bushwick vice high life tumblr mumblecore ullamco. High life pop-up lomo, pariatur exercitation odio helvetica food truck ex williamsburg stumptown hoodie ea polaroid jean shorts. Keytar sed sapiente, mumblecore fixie +1 cred occaecat accusamus. Fanny pack authentic dolor, id four loko dolore ex +1 pop-up. Thundercats cliche aliqua, fugiat irony marfa chambray banksy kogi organic selvage VHS DIY. Id mumblecore nisi, brunch narwhal nostrud vegan squid before they sold out. Sriracha laborum nesciunt, in salvia you probably haven't heard of them mustache VHS commodo squid proident williamsburg. Magna vero gentrify labore, non american apparel occaecat put a bird on it mlkshk DIY occupy eu pinterest aute cliche. Nihil delectus commodo voluptate nostrud. Tattooed tempor skateboard, sed tumblr nostrud chambray put a bird on it non salvia helvetica consectetur mcsweeney's incididunt. Est semiotics ut yr, fanny pack leggings voluptate carles. Ea odd future hoodie cred. Ex small batch wayfarers sartorial. Delectus mumblecore skateboard, kogi esse keytar vinyl sriracha before they sold out typewriter marfa odd future viral mollit. Polaroid biodiesel street art viral cupidatat art party, post-ironic minim. Irony qui reprehenderit, put a bird on it eiusmod iphone labore skateboard. Craft beer keffiyeh echo park, 3 wolf moon thundercats gentrify dolor beard VHS ullamco cillum post-ironic qui chambray. Sartorial cred ex, aliqua trust fund est consectetur put a bird on it in nisi cupidatat sapiente art party freegan. Mlkshk authentic velit laborum. Est tattooed hella pickled qui flexitarian. Mustache wes anderson food truck, cardigan selvage organic wayfarers VHS irure typewriter irony. Kale chips pitchfork four loko before they sold out. Quis blog proident jean shorts voluptate, photo booth high life post-ironic odio hella whatever. Vinyl 3 wolf moon qui, officia non artisan et helvetica cosby sweater velit street art proident quinoa reprehenderit. Odd future fap put a bird on it laboris, kale chips tempor duis velit. Voluptate mlkshk brooklyn nihil. Hoodie sustainable excepteur next level. Anim qui aliqua officia keffiyeh semiotics. Est brooklyn pop-up photo booth, jean shorts banksy mumblecore. Consequat typewriter ennui put a bird on it odio. Reprehenderit narwhal master cleanse, messenger bag sed wayfarers vinyl adipisicing ex nesciunt. Mollit carles ethnic craft beer shoreditch, incididunt veniam laboris small batch authentic dreamcatcher proident you probably haven't heard of them seitan. Id art party narwhal assumenda farm-to-table brooklyn. Seitan artisan adipisicing put a bird on it aute lomo. Next level letterpress pitchfork, master cleanse Austin small batch scenester mlkshk trust fund hella accusamus laboris iphone lo-fi. Minim consectetur fanny pack occupy, lo-fi twee cupidatat nostrud laborum sint. Master cleanse consectetur excepteur enim food truck banksy. Qui nisi truffaut helvetica excepteur. Quinoa banksy non four loko tattooed keffiyeh pickled, ex semiotics quis odd future consectetur flexitarian. Quis readymade 8-bit nisi.
-
-
Keffiyeh mustache pickled post-ironic, lomo vegan food truck helvetica direct trade nostrud. Assumenda odio brunch, DIY non anim delectus sunt aliqua organic VHS nihil pork belly accusamus. Bushwick vice high life tumblr mumblecore ullamco. High life pop-up lomo, pariatur exercitation odio helvetica food truck ex williamsburg stumptown hoodie ea polaroid jean shorts. Keytar sed sapiente, mumblecore fixie +1 cred occaecat accusamus. Fanny pack authentic dolor, id four loko dolore ex +1 pop-up. Thundercats cliche aliqua, fugiat irony marfa chambray banksy kogi organic selvage VHS DIY. Id mumblecore nisi, brunch narwhal nostrud vegan squid before they sold out. Sriracha laborum nesciunt, in salvia you probably haven't heard of them mustache VHS commodo squid proident williamsburg. Magna vero gentrify labore, non american apparel occaecat put a bird on it mlkshk DIY occupy eu pinterest aute cliche. Nihil delectus commodo voluptate nostrud. Tattooed tempor skateboard, sed tumblr nostrud chambray put a bird on it non salvia helvetica consectetur mcsweeney's incididunt. Est semiotics ut yr, fanny pack leggings voluptate carles. Ea odd future hoodie cred. Ex small batch wayfarers sartorial. Delectus mumblecore skateboard, kogi esse keytar vinyl sriracha before they sold out typewriter marfa odd future viral mollit. Polaroid biodiesel street art viral cupidatat art party, post-ironic minim. Irony qui reprehenderit, put a bird on it eiusmod iphone labore skateboard. Craft beer keffiyeh echo park, 3 wolf moon thundercats gentrify dolor beard VHS ullamco cillum post-ironic qui chambray. Sartorial cred ex, aliqua trust fund est consectetur put a bird on it in nisi cupidatat sapiente art party freegan. Mlkshk authentic velit laborum. Est tattooed hella pickled qui flexitarian. Mustache wes anderson food truck, cardigan selvage organic wayfarers VHS irure typewriter irony. Kale chips pitchfork four loko before they sold out. Quis blog proident jean shorts voluptate, photo booth high life post-ironic odio hella whatever. Vinyl 3 wolf moon qui, officia non artisan et helvetica cosby sweater velit street art proident quinoa reprehenderit. Odd future fap put a bird on it laboris, kale chips tempor duis velit. Voluptate mlkshk brooklyn nihil. Hoodie sustainable excepteur next level. Anim qui aliqua officia keffiyeh semiotics. Est brooklyn pop-up photo booth, jean shorts banksy mumblecore. Consequat typewriter ennui put a bird on it odio. Reprehenderit narwhal master cleanse, messenger bag sed wayfarers vinyl adipisicing ex nesciunt. Mollit carles ethnic craft beer shoreditch, incididunt veniam laboris small batch authentic dreamcatcher proident you probably haven't heard of them seitan. Id art party narwhal assumenda farm-to-table brooklyn. Seitan artisan adipisicing put a bird on it aute lomo. Next level letterpress pitchfork, master cleanse Austin small batch scenester mlkshk trust fund hella accusamus laboris iphone lo-fi. Minim consectetur fanny pack occupy, lo-fi twee cupidatat nostrud laborum sint. Master cleanse consectetur excepteur enim food truck banksy. Qui nisi truffaut helvetica excepteur. Quinoa banksy non four loko tattooed keffiyeh pickled, ex semiotics quis odd future consectetur flexitarian. Quis readymade 8-bit nisi.
-
- - - diff --git a/test/flexbox/flexbox-test.html b/test/flexbox/flexbox-test.html deleted file mode 100644 index c301a8ab7..000000000 --- a/test/flexbox/flexbox-test.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - -
-
-
- I should be 100% of the height of my container, right? -
-
-
- I don't have a flex property, so I should have an auto height -
-
- - From be8120e8c6bb23dd69711d15a66ad63db580fc34 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 28 Sep 2012 13:42:55 -0700 Subject: [PATCH 16/72] Add initial support for line highlighting --- src/app/editor.coffee | 21 +++++++++++++++++++++ static/editor.css | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 2946bd866..b9974c362 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -36,6 +36,7 @@ class Editor extends View charWidth: null charHeight: null cursorViews: null + cursorRow: -1 selectionViews: null lineCache: null isFocused: false @@ -343,6 +344,8 @@ class Editor extends View else @gutter.addClass('drop-shadow') + @on 'cursor-move', => @highlightCursorLine() + selectOnMousemoveUntilMouseup: -> moveHandler = (e) => @selectToScreenPosition(@screenPositionFromMouseEvent(e)) @on 'mousemove', moveHandler @@ -746,6 +749,7 @@ class Editor extends View if renderedLines @gutter.renderLineNumbers(renderFrom, renderTo) + @highlightCursorLine() @updatePaddingOfRenderedLines() updatePaddingOfRenderedLines: -> @@ -809,6 +813,7 @@ class Editor extends View charHeight = @charHeight lines = @activeEditSession.linesForScreenRows(startRow, endRow) activeEditSession = @activeEditSession + cursorRow = @cursorRow buildLineHtml = (line) => @buildLineHtml(line) $$ -> @raw(buildLineHtml(line)) for line in lines @@ -932,3 +937,19 @@ class Editor extends View @screenPositionFromPixelPosition top: pageY - @scrollView.offset().top + @scrollTop() left: pageX - @scrollView.offset().left + @scrollView.scrollLeft() + + highlightCursorLine: -> + return if @mini + + newCursorRow = @getCursorBufferPosition().row + emptySelection = @getSelection().isEmpty() + if emptySelection + if @cursorRow isnt newCursorRow + @cursorRow = newCursorRow + screenRow = newCursorRow - @firstRenderedScreenRow + @find('.line.cursor-line').removeClass('cursor-line') + @find(".line:eq(#{screenRow})").addClass('cursor-line') + else if @cursorRow isnt -1 + @find('.line.cursor-line').removeClass('cursor-line') + + @cursorRow = -1 if !emptySelection diff --git a/static/editor.css b/static/editor.css index 63df5ef61..a4bc13bbb 100644 --- a/static/editor.css +++ b/static/editor.css @@ -30,6 +30,10 @@ color: rgba(255, 255, 255, .6); } +.line.cursor-line, .line-number.cursor-line-number { + background-color: rgba(255, 255, 255, .12); +} + .editor.mini .gutter { display: none; } From 2c763a4d486d76efe9ac622e81a72eace677bf52 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Fri, 28 Sep 2012 14:54:18 -0700 Subject: [PATCH 17/72] :lipstick: --- src/app/cursor-view.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/cursor-view.coffee b/src/app/cursor-view.coffee index 326162536..69708acc9 100644 --- a/src/app/cursor-view.coffee +++ b/src/app/cursor-view.coffee @@ -13,10 +13,10 @@ class CursorView extends View hidden: false initialize: (@cursor, @editor) -> - @cursor.on 'change-screen-position.cursor-view', (position, { bufferChange }) => + @cursor.on 'change-screen-position.cursor-view', (screenPosition, { bufferChange }) => @updateAppearance() @removeIdleClassTemporarily() unless bufferChange - @trigger 'cursor-move', bufferChange: bufferChange + @trigger 'cursor-move', {bufferChange} @cursor.on 'destroy.cursor-view', => @remove() From 83ddcde88a40faeafbee9c7715d6922480c8481d Mon Sep 17 00:00:00 2001 From: Corey Johnson & Kevin Sawicki Date: Fri, 28 Sep 2012 14:56:16 -0700 Subject: [PATCH 18/72] Add kevin to .pairs file --- .pairs | 1 + 1 file changed, 1 insertion(+) diff --git a/.pairs b/.pairs index 307920a6c..be6f30427 100644 --- a/.pairs +++ b/.pairs @@ -2,6 +2,7 @@ pairs: ns: Nathan Sobo; nathan cj: Corey Johnson; cj dg: David Graham; dgraham + ks: Kevin Sawicki; kevin email: domain: github.com #global: true From 2863d92ce383b9bab4e1688159cab1a07157898c Mon Sep 17 00:00:00 2001 From: Corey Johnson & Kevin Sawicki Date: Fri, 28 Sep 2012 14:56:41 -0700 Subject: [PATCH 19/72] Use screen position for gutter highlighting --- spec/app/editor-spec.coffee | 42 +++++++++++++++++++++++++++---------- src/app/gutter.coffee | 18 +++++++--------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 45f942ca7..7a26e903a 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1589,18 +1589,38 @@ describe "Editor", -> expect(miniEditor.gutter).toBeHidden() expect(miniEditor.scrollView.css('left')).toBe '0px' - it "highlights the line where the initial cursor position is", -> - { row, column } = editor.getCursorBufferPosition() - expect(row).toBe 0 - expect(editor.find('.line-number.cursor-line-number').length).toBe 1 - expect(editor.find('.line-number.cursor-line-number').text()).toBe "1" + describe "when there is no wrapping", -> + it "highlights the line where the initial cursor position is", -> + { row, column } = editor.getCursorBufferPosition() + expect(row).toBe 0 + expect(editor.find('.line-number.cursor-line-number').length).toBe 1 + expect(editor.find('.line-number.cursor-line-number').text()).toBe "1" - it "updates the highlighted line when the cursor position changes", -> - editor.setCursorBufferPosition([1,0]) - { row, column } = editor.getCursorBufferPosition() - expect(row).toBe 1 - expect(editor.find('.line-number.cursor-line-number').length).toBe 1 - expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" + it "updates the highlighted line when the cursor position changes", -> + editor.setCursorBufferPosition([1,0]) + { row, column } = editor.getCursorBufferPosition() + expect(row).toBe 1 + expect(editor.find('.line-number.cursor-line-number').length).toBe 1 + expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" + + describe "when there is wrapping", -> + beforeEach -> + editor.attachToDom(30) + editor.setSoftWrap(true) + setEditorWidthInChars(editor, 20) + + fit "highlights the line where the initial cursor position is", -> + { row, column } = editor.getCursorBufferPosition() + expect(row).toBe 0 + expect(editor.find('.line-number.cursor-line-number').length).toBe 1 + expect(editor.find('.line-number.cursor-line-number').text()).toBe "1" + + fit "updates the highlighted line when the cursor position changes", -> + editor.setCursorBufferPosition([1,0]) + { row, column } = editor.getCursorBufferPosition() + expect(row).toBe 1 + expect(editor.find('.line-number.cursor-line-number').length).toBe 1 + expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" describe "folding", -> beforeEach -> diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee index c43f9828c..30bd51c2b 100644 --- a/src/app/gutter.coffee +++ b/src/app/gutter.coffee @@ -9,7 +9,7 @@ class Gutter extends View @div class: 'gutter', => @div outlet: 'lineNumbers', class: 'line-numbers' - cursorBufferRow: -1 + cursorScreenRow: -1 firstScreenRow: -1 afterAttach: (onDom) -> @@ -21,13 +21,13 @@ class Gutter extends View renderLineNumbers: (startScreenRow, endScreenRow) -> @firstScreenRow = startScreenRow lastScreenRow = -1 - currentCursorBufferRow = @cursorBufferRow + cursorScreenRow = @cursorScreenRow rows = @editor().bufferRowsForScreenRows(startScreenRow, endScreenRow) @lineNumbers[0].innerHTML = $$$ -> for row in rows rowClass = null - if row isnt currentCursorBufferRow + if row isnt cursorScreenRow or row == lastScreenRow rowClass = 'line-number' else rowClass = 'line-number cursor-line-number' @@ -45,11 +45,9 @@ class Gutter extends View @widthChanged?(@outerWidth()) highlightCursorLine: -> - return if @firstScreenRow < 0 - - newCursorBufferRow = @editor().getCursorBufferPosition().row - if newCursorBufferRow isnt @cursorBufferRow - @cursorBufferRow = newCursorBufferRow - screenRow = @cursorBufferRow - @firstScreenRow + cursorScreenRow = @editor().getCursorScreenPosition().row + if cursorScreenRow isnt @cursorScreenRow + @cursorScreenRow = cursorScreenRow + screenRowIndex = @cursorScreenRow - @firstScreenRow @find('.line-number.cursor-line-number').removeClass('cursor-line-number') - @find(".line-number:eq(#{screenRow})").addClass('cursor-line-number') + @find(".line-number:eq(#{screenRowIndex})").addClass('cursor-line-number') From e15694bb41b7cddd948066b526c020ee2897123d Mon Sep 17 00:00:00 2001 From: Corey Johnson & Kevin Sawicki Date: Fri, 28 Sep 2012 15:18:33 -0700 Subject: [PATCH 20/72] No longer cache cursorScreenRow in gutter highlighting --- spec/app/editor-spec.coffee | 4 ++-- src/app/gutter.coffee | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 7a26e903a..e038264bb 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1609,13 +1609,13 @@ describe "Editor", -> editor.setSoftWrap(true) setEditorWidthInChars(editor, 20) - fit "highlights the line where the initial cursor position is", -> + it "highlights the line where the initial cursor position is", -> { row, column } = editor.getCursorBufferPosition() expect(row).toBe 0 expect(editor.find('.line-number.cursor-line-number').length).toBe 1 expect(editor.find('.line-number.cursor-line-number').text()).toBe "1" - fit "updates the highlighted line when the cursor position changes", -> + it "updates the highlighted line when the cursor position changes", -> editor.setCursorBufferPosition([1,0]) { row, column } = editor.getCursorBufferPosition() expect(row).toBe 1 diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee index 30bd51c2b..d3d29b846 100644 --- a/src/app/gutter.coffee +++ b/src/app/gutter.coffee @@ -9,7 +9,6 @@ class Gutter extends View @div class: 'gutter', => @div outlet: 'lineNumbers', class: 'line-numbers' - cursorScreenRow: -1 firstScreenRow: -1 afterAttach: (onDom) -> @@ -21,17 +20,21 @@ class Gutter extends View renderLineNumbers: (startScreenRow, endScreenRow) -> @firstScreenRow = startScreenRow lastScreenRow = -1 - cursorScreenRow = @cursorScreenRow rows = @editor().bufferRowsForScreenRows(startScreenRow, endScreenRow) + cursorScreenRow = @editor().getCursorScreenPosition().row @lineNumbers[0].innerHTML = $$$ -> for row in rows - rowClass = null - if row isnt cursorScreenRow or row == lastScreenRow - rowClass = 'line-number' + rowClass = 'line-number' + rowValue = null + + if row == lastScreenRow + rowValue = '•' else - rowClass = 'line-number cursor-line-number' - @div {class: rowClass}, if row == lastScreenRow then '•' else row + 1 + rowValue = row + 1 + rowClass += ' cursor-line-number' if row == cursorScreenRow + + @div {class: rowClass}, rowValue lastScreenRow = row @calculateWidth() @@ -46,8 +49,6 @@ class Gutter extends View highlightCursorLine: -> cursorScreenRow = @editor().getCursorScreenPosition().row - if cursorScreenRow isnt @cursorScreenRow - @cursorScreenRow = cursorScreenRow - screenRowIndex = @cursorScreenRow - @firstScreenRow - @find('.line-number.cursor-line-number').removeClass('cursor-line-number') - @find(".line-number:eq(#{screenRowIndex})").addClass('cursor-line-number') + screenRowIndex = cursorScreenRow - @firstScreenRow + @find('.line-number.cursor-line-number').removeClass('cursor-line-number') + @find(".line-number:eq(#{screenRowIndex})").addClass('cursor-line-number') From 6b835920bfb31cabcc90a8b43cd6611762ff8da1 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Kevin Sawicki Date: Fri, 28 Sep 2012 15:48:07 -0700 Subject: [PATCH 21/72] Add padding to gutter numbers instead of entire gutter --- static/editor.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/editor.css b/static/editor.css index a4bc13bbb..b79ae8909 100644 --- a/static/editor.css +++ b/static/editor.css @@ -16,8 +16,6 @@ position: absolute; height: 100%; overflow: hidden; - padding-left: 0.4em; - padding-right: 0.8em; color: rgba(255, 255, 255, .3); text-align: right; } @@ -26,6 +24,11 @@ position: relative; } +.editor .gutter .line-number { + padding-left: 0.4em; + padding-right: 0.8em; +} + .line-number.cursor-line-number { color: rgba(255, 255, 255, .6); } From b1138601fce6d28aa709d1279f6f8bdd42fb4fc5 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Kevin Sawicki Date: Fri, 28 Sep 2012 15:48:56 -0700 Subject: [PATCH 22/72] Use gutter number padding when calculating gutter width --- src/app/gutter.coffee | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee index d3d29b846..1cf0ccd74 100644 --- a/src/app/gutter.coffee +++ b/src/app/gutter.coffee @@ -1,4 +1,4 @@ -{View, $$$} = require 'space-pen' +{View, $$, $$$} = require 'space-pen' $ = require 'jquery' _ = require 'underscore' @@ -10,13 +10,22 @@ class Gutter extends View @div outlet: 'lineNumbers', class: 'line-numbers' firstScreenRow: -1 + highestNumberWidth: null afterAttach: (onDom) -> @editor()?.on 'cursor-move', => @highlightCursorLine() + @calculateWidth() if onDom editor: -> @parentView + lineNumberPadding: -> + widthTesterElement = $$ -> @div {class: 'line-number'}, "" + @append(widthTesterElement) + lineNumberPadding = widthTesterElement.outerWidth() + widthTesterElement.remove() + lineNumberPadding + renderLineNumbers: (startScreenRow, endScreenRow) -> @firstScreenRow = startScreenRow lastScreenRow = -1 @@ -41,14 +50,14 @@ class Gutter extends View @highlightCursorLine() calculateWidth: -> - width = @editor().getLineCount().toString().length * @editor().charWidth - if width != @cachedWidth - @cachedWidth = width - @lineNumbers.width(width) + highestNumberWidth = @editor().getLineCount().toString().length * @editor().charWidth + if highestNumberWidth != @highestNumberWidth + @highestNumberWidth = highestNumberWidth + @lineNumbers.width(highestNumberWidth + @lineNumberPadding()) @widthChanged?(@outerWidth()) highlightCursorLine: -> cursorScreenRow = @editor().getCursorScreenPosition().row screenRowIndex = cursorScreenRow - @firstScreenRow - @find('.line-number.cursor-line-number').removeClass('cursor-line-number') + @find(".line-number.cursor-line-number").removeClass('cursor-line-number') @find(".line-number:eq(#{screenRowIndex})").addClass('cursor-line-number') From 2de14a701fc3e4a3690127856d246906168ac66f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 28 Sep 2012 18:03:19 -0700 Subject: [PATCH 23/72] Set width to 0 on tester element --- src/app/gutter.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee index 1cf0ccd74..e9eccba9b 100644 --- a/src/app/gutter.coffee +++ b/src/app/gutter.coffee @@ -13,14 +13,15 @@ class Gutter extends View highestNumberWidth: null afterAttach: (onDom) -> - @editor()?.on 'cursor-move', => @highlightCursorLine() + @editor().on 'cursor-move', => @highlightCursorLine() @calculateWidth() if onDom editor: -> @parentView - lineNumberPadding: -> + calculateLineNumberPadding: -> widthTesterElement = $$ -> @div {class: 'line-number'}, "" + widthTesterElement.width(0) @append(widthTesterElement) lineNumberPadding = widthTesterElement.outerWidth() widthTesterElement.remove() @@ -53,7 +54,7 @@ class Gutter extends View highestNumberWidth = @editor().getLineCount().toString().length * @editor().charWidth if highestNumberWidth != @highestNumberWidth @highestNumberWidth = highestNumberWidth - @lineNumbers.width(highestNumberWidth + @lineNumberPadding()) + @lineNumbers.width(highestNumberWidth + @calculateLineNumberPadding()) @widthChanged?(@outerWidth()) highlightCursorLine: -> From d69e08a85885c6b6d07755f6be289f2fe5ed21d9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 28 Sep 2012 18:39:30 -0700 Subject: [PATCH 24/72] Use screen rows for line highlight --- spec/app/editor-spec.coffee | 33 +++++++++++++++++++++++++++++++++ src/app/editor.coffee | 19 +++++-------------- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index e038264bb..6be211575 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1622,6 +1622,39 @@ describe "Editor", -> expect(editor.find('.line-number.cursor-line-number').length).toBe 1 expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" + describe "line highlighting", -> + describe "when there is no wrapping", -> + beforeEach -> + editor.attachToDom(30) + + it "highlights the line where the initial cursor position is", -> + expect(editor.getCursorBufferPosition().row).toBe 0 + expect(editor.find('.line.cursor-line').length).toBe 1 + expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(0) + + it "updates the highlighted line when the cursor position changes", -> + editor.setCursorBufferPosition([1,0]) + expect(editor.getCursorBufferPosition().row).toBe 1 + expect(editor.find('.line.cursor-line').length).toBe 1 + expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(1) + + describe "when there is wrapping", -> + beforeEach -> + editor.attachToDom(30) + editor.setSoftWrap(true) + setEditorWidthInChars(editor, 20) + + it "highlights the line where the initial cursor position is", -> + expect(editor.getCursorBufferPosition().row).toBe 0 + expect(editor.find('.line.cursor-line').length).toBe 1 + expect(editor.find('.line.cursor-line').text()).toBe 'var quicksort = ' + + it "updates the highlighted line when the cursor position changes", -> + editor.setCursorBufferPosition([1,0]) + expect(editor.getCursorBufferPosition().row).toBe 1 + expect(editor.find('.line.cursor-line').length).toBe 1 + expect(editor.find('.line.cursor-line').text()).toBe ' var sort = ' + describe "folding", -> beforeEach -> editSession = rootView.project.buildEditSessionForPath('two-hundred.txt') diff --git a/src/app/editor.coffee b/src/app/editor.coffee index b9974c362..225ae4c94 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -36,7 +36,6 @@ class Editor extends View charWidth: null charHeight: null cursorViews: null - cursorRow: -1 selectionViews: null lineCache: null isFocused: false @@ -813,7 +812,7 @@ class Editor extends View charHeight = @charHeight lines = @activeEditSession.linesForScreenRows(startRow, endRow) activeEditSession = @activeEditSession - cursorRow = @cursorRow + cursorScreenRow = @getCursorScreenPosition().row buildLineHtml = (line) => @buildLineHtml(line) $$ -> @raw(buildLineHtml(line)) for line in lines @@ -941,15 +940,7 @@ class Editor extends View highlightCursorLine: -> return if @mini - newCursorRow = @getCursorBufferPosition().row - emptySelection = @getSelection().isEmpty() - if emptySelection - if @cursorRow isnt newCursorRow - @cursorRow = newCursorRow - screenRow = newCursorRow - @firstRenderedScreenRow - @find('.line.cursor-line').removeClass('cursor-line') - @find(".line:eq(#{screenRow})").addClass('cursor-line') - else if @cursorRow isnt -1 - @find('.line.cursor-line').removeClass('cursor-line') - - @cursorRow = -1 if !emptySelection + @cursorScreenRow = @getCursorScreenPosition().row + screenRow = @cursorScreenRow - @firstRenderedScreenRow + @find('.line.cursor-line').removeClass('cursor-line') + @find(".line:eq(#{screenRow})").addClass('cursor-line') From 12a30873cf13c1d51e1a7430891043bb8cfbe2f4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 28 Sep 2012 18:41:44 -0700 Subject: [PATCH 25/72] :lipstick: --- spec/app/editor-spec.coffee | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 6be211575..3e67040be 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1591,15 +1591,13 @@ describe "Editor", -> describe "when there is no wrapping", -> it "highlights the line where the initial cursor position is", -> - { row, column } = editor.getCursorBufferPosition() - expect(row).toBe 0 + expect(editor.getCursorBufferPosition().row).toBe 0 expect(editor.find('.line-number.cursor-line-number').length).toBe 1 expect(editor.find('.line-number.cursor-line-number').text()).toBe "1" it "updates the highlighted line when the cursor position changes", -> editor.setCursorBufferPosition([1,0]) - { row, column } = editor.getCursorBufferPosition() - expect(row).toBe 1 + expect(editor.getCursorBufferPosition().row).toBe 1 expect(editor.find('.line-number.cursor-line-number').length).toBe 1 expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" @@ -1610,15 +1608,13 @@ describe "Editor", -> setEditorWidthInChars(editor, 20) it "highlights the line where the initial cursor position is", -> - { row, column } = editor.getCursorBufferPosition() - expect(row).toBe 0 + expect(editor.getCursorBufferPosition().row).toBe 0 expect(editor.find('.line-number.cursor-line-number').length).toBe 1 expect(editor.find('.line-number.cursor-line-number').text()).toBe "1" it "updates the highlighted line when the cursor position changes", -> editor.setCursorBufferPosition([1,0]) - { row, column } = editor.getCursorBufferPosition() - expect(row).toBe 1 + expect(editor.getCursorBufferPosition().row).toBe 1 expect(editor.find('.line-number.cursor-line-number').length).toBe 1 expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" From 33abaff747aa07c6369605e10f3e466457f34dde Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 28 Sep 2012 19:13:22 -0700 Subject: [PATCH 26/72] Don't highlight line if selection is multiline --- spec/app/editor-spec.coffee | 19 +++++++++++++++---- src/app/editor.coffee | 3 ++- src/app/selection.coffee | 4 ++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 3e67040be..d32b05f90 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1619,10 +1619,10 @@ describe "Editor", -> expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" describe "line highlighting", -> - describe "when there is no wrapping", -> - beforeEach -> - editor.attachToDom(30) + beforeEach -> + editor.attachToDom(30) + describe "when there is no wrapping", -> it "highlights the line where the initial cursor position is", -> expect(editor.getCursorBufferPosition().row).toBe 0 expect(editor.find('.line.cursor-line').length).toBe 1 @@ -1636,7 +1636,6 @@ describe "Editor", -> describe "when there is wrapping", -> beforeEach -> - editor.attachToDom(30) editor.setSoftWrap(true) setEditorWidthInChars(editor, 20) @@ -1651,6 +1650,18 @@ describe "Editor", -> expect(editor.find('.line.cursor-line').length).toBe 1 expect(editor.find('.line.cursor-line').text()).toBe ' var sort = ' + describe "when there is a selection", -> + it "highlights if the selection is contained to one line", -> + editor.getSelection().setBufferRange(new Range([0,0],[0,1])) + expect(editor.getSelection().isMultiLine()).toBe false + expect(editor.find('.line.cursor-line').length).toBe 1 + expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(0) + + it "doesn't highlight if the selection spans multiple lines", -> + editor.getSelection().setBufferRange(new Range([0,0],[2,0])) + expect(editor.getSelection().isMultiLine()).toBe true + expect(editor.find('.line.cursor-line').length).toBe 0 + describe "folding", -> beforeEach -> editSession = rootView.project.buildEditSessionForPath('two-hundred.txt') diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 225ae4c94..d2e00e549 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -943,4 +943,5 @@ class Editor extends View @cursorScreenRow = @getCursorScreenPosition().row screenRow = @cursorScreenRow - @firstRenderedScreenRow @find('.line.cursor-line').removeClass('cursor-line') - @find(".line:eq(#{screenRow})").addClass('cursor-line') + if !@getSelection().isMultiLine() + @find(".line:eq(#{screenRow})").addClass('cursor-line') diff --git a/src/app/selection.coffee b/src/app/selection.coffee index eca63c7ff..8daad3198 100644 --- a/src/app/selection.coffee +++ b/src/app/selection.coffee @@ -31,6 +31,10 @@ class Selection isReversed: -> not @isEmpty() and @cursor.getBufferPosition().isLessThan(@anchor.getBufferPosition()) + isMultiLine: -> + range = @getScreenRange() + range.start.row != range.end.row + getScreenRange: -> if @anchor new Range(@anchor.getScreenPosition(), @cursor.getScreenPosition()) From a4ad5829a56dd7d27f4e6af561e133606b96003c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 28 Sep 2012 19:19:43 -0700 Subject: [PATCH 27/72] Disable gutter background highlight on multiline selections --- spec/app/editor-spec.coffee | 17 ++++++++++++++--- src/app/gutter.coffee | 11 +++++++++-- static/editor.css | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index d32b05f90..a3cd1add7 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1609,14 +1609,25 @@ describe "Editor", -> it "highlights the line where the initial cursor position is", -> expect(editor.getCursorBufferPosition().row).toBe 0 - expect(editor.find('.line-number.cursor-line-number').length).toBe 1 - expect(editor.find('.line-number.cursor-line-number').text()).toBe "1" + expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').length).toBe 1 + expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').text()).toBe "1" it "updates the highlighted line when the cursor position changes", -> editor.setCursorBufferPosition([1,0]) expect(editor.getCursorBufferPosition().row).toBe 1 + expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').length).toBe 1 + expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').text()).toBe "2" + + describe "when the selection spans multiple lines", -> + beforeEach -> + editor.attachToDom(30) + + it "doesn't highlight the backround", -> + editor.getSelection().setBufferRange(new Range([0,0],[2,0])) + expect(editor.getSelection().isMultiLine()).toBe true expect(editor.find('.line-number.cursor-line-number').length).toBe 1 - expect(editor.find('.line-number.cursor-line-number').text()).toBe "2" + expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').length).toBe 0 + expect(editor.find('.line-number.cursor-line-number').text()).toBe "3" describe "line highlighting", -> beforeEach -> diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee index e9eccba9b..ef6f744e0 100644 --- a/src/app/gutter.coffee +++ b/src/app/gutter.coffee @@ -60,5 +60,12 @@ class Gutter extends View highlightCursorLine: -> cursorScreenRow = @editor().getCursorScreenPosition().row screenRowIndex = cursorScreenRow - @firstScreenRow - @find(".line-number.cursor-line-number").removeClass('cursor-line-number') - @find(".line-number:eq(#{screenRowIndex})").addClass('cursor-line-number') + + currentLineNumberRow = @find(".line-number.cursor-line-number") + currentLineNumberRow.removeClass('cursor-line-number') + currentLineNumberRow.removeClass('cursor-line-number-background') + + newLineNumberRow = @find(".line-number:eq(#{screenRowIndex})") + newLineNumberRow.addClass('cursor-line-number') + if !@editor().getSelection().isMultiLine() + newLineNumberRow.addClass('cursor-line-number-background') diff --git a/static/editor.css b/static/editor.css index b79ae8909..54b1284e5 100644 --- a/static/editor.css +++ b/static/editor.css @@ -33,7 +33,7 @@ color: rgba(255, 255, 255, .6); } -.line.cursor-line, .line-number.cursor-line-number { +.line.cursor-line, .line-number.cursor-line-number-background { background-color: rgba(255, 255, 255, .12); } From a03512fd90748c23520cccf3842c409cc66abf9d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sat, 29 Sep 2012 12:18:02 -0700 Subject: [PATCH 28/72] Add line number padding to expected width --- spec/app/editor-spec.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index a3cd1add7..a7e3cad09 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -1494,18 +1494,18 @@ describe "Editor", -> describe "width", -> it "sets the width based on largest line number", -> - expect(editor.gutter.lineNumbers.outerWidth()).toBe editor.charWidth * 2 + expect(editor.gutter.lineNumbers.outerWidth()).toBe(editor.charWidth * 2 + editor.gutter.calculateLineNumberPadding()) it "updates the width and the left position of the scroll view when total number of lines gains a digit", -> editor.setText("") - expect(editor.gutter.lineNumbers.outerWidth()).toBe editor.charWidth * 1 + expect(editor.gutter.lineNumbers.outerWidth()).toBe(editor.charWidth * 1 + editor.gutter.calculateLineNumberPadding()) expect(parseInt(editor.scrollView.css('left'))).toBe editor.gutter.outerWidth() for i in [1..9] # Ends on an empty line 10 editor.insertText "#{i}\n" - expect(editor.gutter.lineNumbers.outerWidth()).toBe editor.charWidth * 2 + expect(editor.gutter.lineNumbers.outerWidth()).toBe(editor.charWidth * 2 + editor.gutter.calculateLineNumberPadding()) expect(parseInt(editor.scrollView.css('left'))).toBe editor.gutter.outerWidth() describe "when lines are inserted", -> From f87b18653840a1a63eeee4b0358f291f80bfd883 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Sat, 29 Sep 2012 12:47:04 -0700 Subject: [PATCH 29/72] Add highlight to new line html builder --- src/app/editor.coffee | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/app/editor.coffee b/src/app/editor.coffee index d2e00e549..17d27d61e 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -814,10 +814,15 @@ class Editor extends View activeEditSession = @activeEditSession cursorScreenRow = @getCursorScreenPosition().row - buildLineHtml = (line) => @buildLineHtml(line) - $$ -> @raw(buildLineHtml(line)) for line in lines + buildLineHtml = (line, lineClasses) => @buildLineHtml(line, lineClasses) + $$ -> + row = startRow + for line in lines + lineClasses = if row is cursorScreenRow then ' cursor-line' else null + @raw(buildLineHtml(line, lineClasses)) + row++ - buildLineHtml: (screenLine) -> + buildLineHtml: (screenLine, lineClasses) -> scopeStack = [] line = [] @@ -849,6 +854,8 @@ class Editor extends View else lineAttributes = { class: 'line' } + lineAttributes.class += lineClasses if lineClasses + attributePairs = [] attributePairs.push "#{attributeName}=\"#{value}\"" for attributeName, value of lineAttributes line.push("
")
@@ -942,6 +949,6 @@ class Editor extends View
 
     @cursorScreenRow = @getCursorScreenPosition().row
     screenRow = @cursorScreenRow - @firstRenderedScreenRow
-    @find('.line.cursor-line').removeClass('cursor-line')
+    @find('pre.line.cursor-line').removeClass('cursor-line')
     if !@getSelection().isMultiLine()
-      @find(".line:eq(#{screenRow})").addClass('cursor-line')
+      @find("pre.line:eq(#{screenRow})").addClass('cursor-line')

From e039dab0f6bed01551c62ee8ff89cf956a7c67ad Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 10:18:37 -0700
Subject: [PATCH 30/72] Don't highlight line in mini editor

---
 spec/app/editor-spec.coffee | 6 ++++++
 src/app/editor.coffee       | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index a7e3cad09..897fe81e8 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1589,6 +1589,12 @@ describe "Editor", ->
         expect(miniEditor.gutter).toBeHidden()
         expect(miniEditor.scrollView.css('left')).toBe '0px'
 
+      it "doesn't highlight the only line", ->
+        miniEditor = new Editor(mini: true)
+        miniEditor.attachToDom()
+        expect(miniEditor.getCursorBufferPosition().row).toBe 0
+        expect(miniEditor.find('.line.cursor-line').length).toBe 0
+
     describe "when there is no wrapping", ->
       it "highlights the line where the initial cursor position is", ->
         expect(editor.getCursorBufferPosition().row).toBe 0
diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index 17d27d61e..87ab13012 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -818,7 +818,10 @@ class Editor extends View
     $$ ->
       row = startRow
       for line in lines
-        lineClasses = if row is cursorScreenRow then ' cursor-line' else null
+        if @mini or row isnt cursorScreenRow
+          lineClasses = null
+        else
+          lineClasses = 'cursor-line'
         @raw(buildLineHtml(line, lineClasses))
         row++
 

From d5b1146b9ba2dee81e2fa753f8ac1d1f8ef2aadf Mon Sep 17 00:00:00 2001
From: Corey Johnson 
Date: Mon, 1 Oct 2012 10:32:30 -0700
Subject: [PATCH 31/72] Only call gutter.afterAttach once

---
 src/app/gutter.coffee | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee
index ef6f744e0..d8668be3c 100644
--- a/src/app/gutter.coffee
+++ b/src/app/gutter.coffee
@@ -13,8 +13,10 @@ class Gutter extends View
   highestNumberWidth: null
 
   afterAttach: (onDom) ->
+    return if @attached or not onDom
+    @attached = true
     @editor().on 'cursor-move', => @highlightCursorLine()
-    @calculateWidth() if onDom
+    @calculateWidth()
 
   editor: ->
     @parentView

From 350e1a22da901782369f40cb1f61218ccaa9ad95 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 10:57:29 -0700
Subject: [PATCH 32/72] Add missing space in class name

---
 src/app/editor.coffee | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index 87ab13012..be0417708 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -821,7 +821,7 @@ class Editor extends View
         if @mini or row isnt cursorScreenRow
           lineClasses = null
         else
-          lineClasses = 'cursor-line'
+          lineClasses = ' cursor-line'
         @raw(buildLineHtml(line, lineClasses))
         row++
 

From 0059accaa4b9f25f6d49072a16e0c556fcee71b6 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 11:03:21 -0700
Subject: [PATCH 33/72] Access correct editor mini variable

---
 src/app/editor.coffee | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index be0417708..c93242965 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -813,12 +813,13 @@ class Editor extends View
     lines = @activeEditSession.linesForScreenRows(startRow, endRow)
     activeEditSession = @activeEditSession
     cursorScreenRow = @getCursorScreenPosition().row
+    mini = @mini
 
     buildLineHtml = (line, lineClasses) => @buildLineHtml(line, lineClasses)
     $$ ->
       row = startRow
       for line in lines
-        if @mini or row isnt cursorScreenRow
+        if mini or row isnt cursorScreenRow
           lineClasses = null
         else
           lineClasses = ' cursor-line'

From 9361b0717cc9d8a255be655cf94c282d33cd6cd6 Mon Sep 17 00:00:00 2001
From: Corey Johnson 
Date: Mon, 1 Oct 2012 10:42:15 -0700
Subject: [PATCH 34/72] Give gutter line highlighting its own `describe`

---
 spec/app/editor-spec.coffee | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index 897fe81e8..cbf56a6d8 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1595,6 +1595,11 @@ describe "Editor", ->
         expect(miniEditor.getCursorBufferPosition().row).toBe 0
         expect(miniEditor.find('.line.cursor-line').length).toBe 0
 
+
+  describe "gutter line highlighting", ->
+    beforeEach ->
+      editor.attachToDom(heightInLines: 5.5)
+
     describe "when there is no wrapping", ->
       it "highlights the line where the initial cursor position is", ->
         expect(editor.getCursorBufferPosition().row).toBe 0

From 905ab5e7367e4d200b06bfecec55eec665d9ebd3 Mon Sep 17 00:00:00 2001
From: Corey Johnson 
Date: Mon, 1 Oct 2012 11:08:59 -0700
Subject: [PATCH 35/72] Only highlight line and gutter row if editor is active

---
 static/editor.css | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/static/editor.css b/static/editor.css
index 54b1284e5..70087e223 100644
--- a/static/editor.css
+++ b/static/editor.css
@@ -29,11 +29,11 @@
   padding-right: 0.8em;
 }
 
-.line-number.cursor-line-number {
+.editor.focused .line-number.cursor-line-number {
   color: rgba(255, 255, 255, .6);
 }
 
-.line.cursor-line, .line-number.cursor-line-number-background {
+.editor.focused .line.cursor-line, .editor.focused .line-number.cursor-line-number-background {
   background-color: rgba(255, 255, 255, .12);
 }
 

From 887720e4de02c40cd9528660317165c43b78108f Mon Sep 17 00:00:00 2001
From: Corey Johnson 
Date: Mon, 1 Oct 2012 11:58:51 -0700
Subject: [PATCH 36/72] [fail] added failing gutter spec

When you remove a newline with backspace, the background on the gutter line number isn't highlighted. This is to help @kevinsawicki debug the problem.
---
 spec/app/editor-spec.coffee | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index cbf56a6d8..ad8de671a 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1640,6 +1640,14 @@ describe "Editor", ->
         expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').length).toBe 0
         expect(editor.find('.line-number.cursor-line-number').text()).toBe "3"
 
+    fit "when a newline is deleted with backspace, the line number of the new cursor position is highlighted (regression)", ->
+      editor.setCursorScreenPosition([1,0])
+      editor.backspace()
+      expect(editor.find('.line-number.cursor-line-number').length).toBe 1
+      expect(editor.find('.line-number.cursor-line-number').text()).toBe "1"
+      expect(editor.find('.line-number.cursor-line-number-background').length).toBe 1
+      expect(editor.find('.line-number.cursor-line-number-background').text()).toBe "1"
+
   describe "line highlighting", ->
     beforeEach ->
       editor.attachToDom(30)

From f2306f444a84297cec0454aaa32bb08548d1a44a Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 12:11:30 -0700
Subject: [PATCH 37/72] :lipstick:

---
 spec/app/editor-spec.coffee | 6 +++---
 src/app/editor.coffee       | 2 +-
 src/app/gutter.coffee       | 2 +-
 src/app/selection.coffee    | 5 ++---
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index ad8de671a..7e68c5b81 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1635,7 +1635,7 @@ describe "Editor", ->
 
       it "doesn't highlight the backround", ->
         editor.getSelection().setBufferRange(new Range([0,0],[2,0]))
-        expect(editor.getSelection().isMultiLine()).toBe true
+        expect(editor.getSelection().isSingleScreenLine()).toBe false
         expect(editor.find('.line-number.cursor-line-number').length).toBe 1
         expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').length).toBe 0
         expect(editor.find('.line-number.cursor-line-number').text()).toBe "3"
@@ -1683,13 +1683,13 @@ describe "Editor", ->
     describe "when there is a selection", ->
       it "highlights if the selection is contained to one line", ->
         editor.getSelection().setBufferRange(new Range([0,0],[0,1]))
-        expect(editor.getSelection().isMultiLine()).toBe false
+        expect(editor.getSelection().isSingleScreenLine()).toBe true
         expect(editor.find('.line.cursor-line').length).toBe 1
         expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(0)
 
       it "doesn't highlight if the selection spans multiple lines", ->
         editor.getSelection().setBufferRange(new Range([0,0],[2,0]))
-        expect(editor.getSelection().isMultiLine()).toBe true
+        expect(editor.getSelection().isSingleScreenLine()).toBe false
         expect(editor.find('.line.cursor-line').length).toBe 0
 
   describe "folding", ->
diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index c93242965..fe6dc5d8b 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -954,5 +954,5 @@ class Editor extends View
     @cursorScreenRow = @getCursorScreenPosition().row
     screenRow = @cursorScreenRow - @firstRenderedScreenRow
     @find('pre.line.cursor-line').removeClass('cursor-line')
-    if !@getSelection().isMultiLine()
+    if @getSelection().isSingleScreenLine()
       @find("pre.line:eq(#{screenRow})").addClass('cursor-line')
diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee
index d8668be3c..23f4a772d 100644
--- a/src/app/gutter.coffee
+++ b/src/app/gutter.coffee
@@ -69,5 +69,5 @@ class Gutter extends View
 
     newLineNumberRow = @find(".line-number:eq(#{screenRowIndex})")
     newLineNumberRow.addClass('cursor-line-number')
-    if !@editor().getSelection().isMultiLine()
+    if @editor().getSelection().isSingleScreenLine()
       newLineNumberRow.addClass('cursor-line-number-background')
diff --git a/src/app/selection.coffee b/src/app/selection.coffee
index 8daad3198..0e0b711f7 100644
--- a/src/app/selection.coffee
+++ b/src/app/selection.coffee
@@ -31,9 +31,8 @@ class Selection
   isReversed: ->
     not @isEmpty() and @cursor.getBufferPosition().isLessThan(@anchor.getBufferPosition())
 
-  isMultiLine: ->
-    range = @getScreenRange()
-    range.start.row != range.end.row
+  isSingleScreenLine: ->
+    @getScreenRange().isSingleLine()
 
   getScreenRange: ->
     if @anchor

From 2bea67057bc48457e47da5ffaa09147e9f2dfbca Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 13:39:41 -0700
Subject: [PATCH 38/72] Add spec for line highlight after backspace

---
 spec/app/editor-spec.coffee | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index 7e68c5b81..7c6e4735f 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1664,6 +1664,11 @@ describe "Editor", ->
         expect(editor.find('.line.cursor-line').length).toBe 1
         expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(1)
 
+      fit "when a newline is deleted with backspace, the line of the new cursor position is highlighted (regression)", ->
+        editor.setCursorScreenPosition([1,0])
+        editor.backspace()
+        expect(editor.find('.line.cursor-line').length).toBe 1
+
     describe "when there is wrapping", ->
       beforeEach ->
         editor.setSoftWrap(true)

From c7361d487f6160e655be1e3eba1b69344eb742b3 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 14:40:33 -0700
Subject: [PATCH 39/72] Update cursor line when selection screen range changes

---
 spec/app/editor-spec.coffee | 2 +-
 src/app/editor.coffee       | 3 +++
 src/app/gutter.coffee       | 6 +++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index 7c6e4735f..3b315725d 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1640,7 +1640,7 @@ describe "Editor", ->
         expect(editor.find('.line-number.cursor-line-number.cursor-line-number-background').length).toBe 0
         expect(editor.find('.line-number.cursor-line-number').text()).toBe "3"
 
-    fit "when a newline is deleted with backspace, the line number of the new cursor position is highlighted (regression)", ->
+    it "when a newline is deleted with backspace, the line number of the new cursor position is highlighted", ->
       editor.setCursorScreenPosition([1,0])
       editor.backspace()
       expect(editor.find('.line-number.cursor-line-number').length).toBe 1
diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index fe6dc5d8b..840e5c22f 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -417,6 +417,9 @@ class Editor extends View
     @activeEditSession.on "buffer-path-change", =>
       @trigger 'editor-path-change'
 
+    @activeEditSession.getSelection().on 'change-screen-range', =>
+      @trigger 'editor-selection-change'
+
     @trigger 'editor-path-change'
     @renderWhenAttached()
 
diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee
index 23f4a772d..026d1d41f 100644
--- a/src/app/gutter.coffee
+++ b/src/app/gutter.coffee
@@ -15,7 +15,11 @@ class Gutter extends View
   afterAttach: (onDom) ->
     return if @attached or not onDom
     @attached = true
-    @editor().on 'cursor-move', => @highlightCursorLine()
+
+    editor = @editor()
+    highlightCursorLine = => @highlightCursorLine()
+    editor.on 'cursor-move', highlightCursorLine
+    editor.on 'editor-selection-change', highlightCursorLine
     @calculateWidth()
 
   editor: ->

From 41cdf130fbcfe98d305f80f4b759315c089d23c8 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 15:19:25 -0700
Subject: [PATCH 40/72] Update highlighted line when editor selection changes

---
 spec/app/editor-spec.coffee | 2 +-
 src/app/editor.coffee       | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index 3b315725d..d8eb7a744 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1664,7 +1664,7 @@ describe "Editor", ->
         expect(editor.find('.line.cursor-line').length).toBe 1
         expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(1)
 
-      fit "when a newline is deleted with backspace, the line of the new cursor position is highlighted (regression)", ->
+      it "when a newline is deleted with backspace, the line of the new cursor position is highlighted", ->
         editor.setCursorScreenPosition([1,0])
         editor.backspace()
         expect(editor.find('.line.cursor-line').length).toBe 1
diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index 840e5c22f..39ec9190e 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -344,6 +344,7 @@ class Editor extends View
         @gutter.addClass('drop-shadow')
 
     @on 'cursor-move', => @highlightCursorLine()
+    @on 'editor-selection-change', => @highlightCursorLine()
 
   selectOnMousemoveUntilMouseup: ->
     moveHandler = (e) => @selectToScreenPosition(@screenPositionFromMouseEvent(e))

From edfd61c7025e065db741c8bb5c36b2dbbad76e0d Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 15:26:27 -0700
Subject: [PATCH 41/72] Remove unneeded class addition

---
 spec/app/editor-spec.coffee | 2 +-
 src/app/gutter.coffee       | 7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index d8eb7a744..e666cc1e6 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1596,7 +1596,7 @@ describe "Editor", ->
         expect(miniEditor.find('.line.cursor-line').length).toBe 0
 
 
-  describe "gutter line highlighting", ->
+  fdescribe "gutter line highlighting", ->
     beforeEach ->
       editor.attachToDom(heightInLines: 5.5)
 
diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee
index 026d1d41f..12b65f957 100644
--- a/src/app/gutter.coffee
+++ b/src/app/gutter.coffee
@@ -41,16 +41,11 @@ class Gutter extends View
     cursorScreenRow = @editor().getCursorScreenPosition().row
     @lineNumbers[0].innerHTML = $$$ ->
       for row in rows
-        rowClass = 'line-number'
-        rowValue = null
-
         if row == lastScreenRow
           rowValue = '•'
         else
           rowValue = row + 1
-          rowClass += ' cursor-line-number' if row == cursorScreenRow
-
-        @div {class: rowClass}, rowValue
+        @div {class: 'line-number'}, rowValue
         lastScreenRow = row
 
     @calculateWidth()

From b7f32036c2ceb04bf55fec3eaa8a732d75ffc355 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 15:40:39 -0700
Subject: [PATCH 42/72] Change editor-selection-change event name to
 selection-change

---
 spec/app/editor-spec.coffee | 2 +-
 src/app/editor.coffee       | 4 ++--
 src/app/gutter.coffee       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee
index e666cc1e6..d8eb7a744 100644
--- a/spec/app/editor-spec.coffee
+++ b/spec/app/editor-spec.coffee
@@ -1596,7 +1596,7 @@ describe "Editor", ->
         expect(miniEditor.find('.line.cursor-line').length).toBe 0
 
 
-  fdescribe "gutter line highlighting", ->
+  describe "gutter line highlighting", ->
     beforeEach ->
       editor.attachToDom(heightInLines: 5.5)
 
diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index 39ec9190e..f74693356 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -344,7 +344,7 @@ class Editor extends View
         @gutter.addClass('drop-shadow')
 
     @on 'cursor-move', => @highlightCursorLine()
-    @on 'editor-selection-change', => @highlightCursorLine()
+    @on 'selection-change', => @highlightCursorLine()
 
   selectOnMousemoveUntilMouseup: ->
     moveHandler = (e) => @selectToScreenPosition(@screenPositionFromMouseEvent(e))
@@ -419,7 +419,7 @@ class Editor extends View
       @trigger 'editor-path-change'
 
     @activeEditSession.getSelection().on 'change-screen-range', =>
-      @trigger 'editor-selection-change'
+      @trigger 'selection-change'
 
     @trigger 'editor-path-change'
     @renderWhenAttached()
diff --git a/src/app/gutter.coffee b/src/app/gutter.coffee
index 12b65f957..0361de79f 100644
--- a/src/app/gutter.coffee
+++ b/src/app/gutter.coffee
@@ -19,7 +19,7 @@ class Gutter extends View
     editor = @editor()
     highlightCursorLine = => @highlightCursorLine()
     editor.on 'cursor-move', highlightCursorLine
-    editor.on 'editor-selection-change', highlightCursorLine
+    editor.on 'selection-change', highlightCursorLine
     @calculateWidth()
 
   editor: ->

From 73653b5fa807dbcb1803894dc769e639fba47008 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 15:59:41 -0700
Subject: [PATCH 43/72] Doc how line highlighting can be tweaked

---
 .github         |  2 +-
 docs/styling.md | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 docs/styling.md

diff --git a/.github b/.github
index 900b87d40..97fbb4616 100644
--- a/.github
+++ b/.github
@@ -1,3 +1,3 @@
 [docs]
 	title = The Guide to Atom
-	manifest = intro.md, extensions/intro.md, extensions/markdown-preview.md, extensions/wrap-guide.md
+	manifest = intro.md, styling.md, extensions/intro.md, extensions/markdown-preview.md, extensions/wrap-guide.md
diff --git a/docs/styling.md b/docs/styling.md
new file mode 100644
index 000000000..83adf8132
--- /dev/null
+++ b/docs/styling.md
@@ -0,0 +1,24 @@
+## Styling Tweaks
+
+### Cursor Line Highlighting
+
+Atom highlights the background color of the entire line where the cursor
+currently is and also changes the foreground color of the line number in the
+gutter.
+
+You can change the background color using the following CSS:
+
+```css
+.editor.focused .line.cursor-line,
+.editor.focused .line-number.cursor-line-number-background {
+  background-color: green;
+}
+```
+
+You can change the line number foreground color using the following CSS:
+
+```css
+.editor.focused .line-number.cursor-line-number {
+  color: blue;
+}
+```

From 2b3991d74e7bd61ea3e3ea7385a592ecb2cfd147 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 19:18:13 -0700
Subject: [PATCH 44/72] Use tree-view fixtures dir in tree-view specs

---
 spec/extensions/tree-view-spec.coffee         | 64 +++++++++----------
 .../nested2/.gitkeep => tree-view/dir1/file1} |  0
 .../tree-view/dir1/sub-dir1/sub-file1         |  0
 spec/fixtures/tree-view/dir2/file2            |  0
 .../tree-view/nested/nested2/.gitkeep         |  0
 spec/fixtures/tree-view/tree-view.js          | 13 ++++
 spec/fixtures/tree-view/tree-view.txt         |  1 +
 spec/stdlib/fs-spec.coffee                    |  2 +-
 8 files changed, 47 insertions(+), 33 deletions(-)
 rename spec/fixtures/{nested/nested2/.gitkeep => tree-view/dir1/file1} (100%)
 create mode 100644 spec/fixtures/tree-view/dir1/sub-dir1/sub-file1
 create mode 100644 spec/fixtures/tree-view/dir2/file2
 create mode 100644 spec/fixtures/tree-view/nested/nested2/.gitkeep
 create mode 100644 spec/fixtures/tree-view/tree-view.js
 create mode 100644 spec/fixtures/tree-view/tree-view.txt

diff --git a/spec/extensions/tree-view-spec.coffee b/spec/extensions/tree-view-spec.coffee
index 9dc278fb4..1739bec97 100644
--- a/spec/extensions/tree-view-spec.coffee
+++ b/spec/extensions/tree-view-spec.coffee
@@ -10,14 +10,14 @@ describe "TreeView", ->
   [rootView, project, treeView, sampleJs, sampleTxt] = []
 
   beforeEach ->
-    rootView = new RootView(require.resolve('fixtures/'))
+    rootView = new RootView(require.resolve('fixtures/tree-view'))
     project = rootView.project
 
     rootView.activateExtension(TreeView)
     treeView = rootView.find(".tree-view").view()
     treeView.root = treeView.find('> li:first').view()
-    sampleJs = treeView.find('.file:contains(sample.js)')
-    sampleTxt = treeView.find('.file:contains(sample.txt)')
+    sampleJs = treeView.find('.file:contains(tree-view.js)')
+    sampleTxt = treeView.find('.file:contains(tree-view.txt)')
 
     expect(treeView.root.directory.subscriptionCount()).toBeGreaterThan 0
 
@@ -27,21 +27,21 @@ describe "TreeView", ->
   describe ".initialize(project)", ->
     it "renders the root of the project and its contents alphabetically with subdirectories first in a collapsed state", ->
       expect(treeView.root.find('> .header .disclosure-arrow')).toHaveText('▾')
-      expect(treeView.root.find('> .header .name')).toHaveText('fixtures/')
+      expect(treeView.root.find('> .header .name')).toHaveText('tree-view/')
 
       rootEntries = treeView.root.find('.entries')
       subdir0 = rootEntries.find('> li:eq(0)')
       expect(subdir0.find('.disclosure-arrow')).toHaveText('▸')
-      expect(subdir0.find('.name')).toHaveText('dir/')
+      expect(subdir0.find('.name')).toHaveText('dir1/')
       expect(subdir0.find('.entries')).not.toExist()
 
-      subdir2 = rootEntries.find('> li:eq(3)')
+      subdir2 = rootEntries.find('> li:eq(1)')
       expect(subdir2.find('.disclosure-arrow')).toHaveText('▸')
-      expect(subdir2.find('.name')).toHaveText('zed/')
+      expect(subdir2.find('.name')).toHaveText('dir2/')
       expect(subdir2.find('.entries')).not.toExist()
 
-      expect(rootEntries.find('> .file:contains(sample.js)')).toExist()
-      expect(rootEntries.find('> .file:contains(sample.txt)')).toExist()
+      expect(rootEntries.find('> .file:contains(tree-view.js)')).toExist()
+      expect(rootEntries.find('> .file:contains(tree-view.txt)')).toExist()
 
     it "selects the rootview", ->
       expect(treeView.selectedEntry()).toEqual treeView.root
@@ -84,7 +84,7 @@ describe "TreeView", ->
       newRootView?.deactivate()
 
     it "restores expanded directories and selected file when deserialized", ->
-      treeView.find('.directory:contains(zed)').click()
+      treeView.find('.directory:contains(dir1)').click()
       sampleJs.click()
       newRootView = RootView.deserialize(rootView.serialize())
       rootView.deactivate() # Deactivates previous TreeView
@@ -94,8 +94,8 @@ describe "TreeView", ->
       newTreeView = newRootView.find(".tree-view").view()
 
       expect(newTreeView).toExist()
-      expect(newTreeView.selectedEntry()).toMatchSelector(".file:contains(sample.js)")
-      expect(newTreeView.find(".directory:contains(zed)")).toHaveClass("expanded")
+      expect(newTreeView.selectedEntry()).toMatchSelector(".file:contains(tree-view.js)")
+      expect(newTreeView.find(".directory:contains(dir1)")).toHaveClass("expanded")
 
     it "restores the focus state of the tree view", ->
       rootView.attachToDom()
@@ -112,7 +112,7 @@ describe "TreeView", ->
       expect(newTreeView).toMatchSelector ':focus'
 
     it "restores the scroll top when toggled", ->
-      rootView.height(100)
+      rootView.height(5)
       rootView.attachToDom()
       expect(treeView).toBeVisible()
       treeView.focus()
@@ -162,11 +162,11 @@ describe "TreeView", ->
 
     describe "if the current file has a path", ->
       it "shows and focuses the tree view and selects the file", ->
-        rootView.open('dir/a')
+        rootView.open('dir1/file1')
         rootView.trigger 'tree-view:reveal-active-file'
         expect(treeView.hasParent()).toBeTruthy()
         expect(treeView.focus).toHaveBeenCalled()
-        expect(treeView.selectedEntry().getPath()).toMatch /dir\/a$/
+        expect(treeView.selectedEntry().getPath()).toMatch /dir1\/file1$/
 
     describe "if the current file has no path", ->
       it "shows and focuses the tree view, but does not attempt to select a specific file", ->
@@ -196,7 +196,7 @@ describe "TreeView", ->
 
   describe "when a directory's disclosure arrow is clicked", ->
     it "expands / collapses the associated directory", ->
-      subdir = treeView.root.find('.entries > li:contains(dir/)').view()
+      subdir = treeView.root.find('.entries > li:contains(dir1/)').view()
 
       expect(subdir.disclosureArrow).toHaveText('▸')
       expect(subdir.find('.entries')).not.toExist()
@@ -211,10 +211,10 @@ describe "TreeView", ->
       expect(subdir.find('.entries')).not.toExist()
 
     it "restores the expansion state of descendant directories", ->
-      child = treeView.root.find('.entries > li:contains(dir/)').view()
+      child = treeView.root.find('.entries > li:contains(dir1/)').view()
       child.disclosureArrow.click()
 
-      grandchild = child.find('.entries > li:contains(a-dir/)').view()
+      grandchild = child.find('.entries > li:contains(sub-dir1/)').view()
       grandchild.disclosureArrow.click()
 
       treeView.root.disclosureArrow.click()
@@ -222,16 +222,16 @@ describe "TreeView", ->
       treeView.root.disclosureArrow.click()
 
       # previously expanded descendants remain expanded
-      expect(treeView.root.find('> .entries > li:contains(dir/) > .entries > li:contains(a-dir/) > .entries').length).toBe 1
+      expect(treeView.root.find('> .entries > li:contains(dir1/) > .entries > li:contains(sub-dir1/) > .entries').length).toBe 1
 
       # collapsed descendants remain collapsed
-      expect(treeView.root.find('> .entries > li.contains(zed/) > .entries')).not.toExist()
+      expect(treeView.root.find('> .entries > li.contains(dir2/) > .entries')).not.toExist()
 
     it "when collapsing a directory, removes change subscriptions from the collapsed directory and its descendants", ->
-      child = treeView.root.entries.find('li:contains(dir/)').view()
+      child = treeView.root.entries.find('li:contains(dir1/)').view()
       child.disclosureArrow.click()
 
-      grandchild = child.entries.find('li:contains(a-dir/)').view()
+      grandchild = child.entries.find('li:contains(sub-dir1/)').view()
       grandchild.disclosureArrow.click()
 
       expect(treeView.root.directory.subscriptionCount()).toBe 1
@@ -250,20 +250,20 @@ describe "TreeView", ->
 
       sampleJs.trigger clickEvent(originalEvent: { detail: 1 })
       expect(sampleJs).toHaveClass 'selected'
-      expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/sample.js')
+      expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/tree-view/tree-view.js')
       expect(rootView.getActiveEditor().isFocused).toBeFalsy()
 
       sampleTxt.trigger clickEvent(originalEvent: { detail: 1 })
       expect(sampleTxt).toHaveClass 'selected'
       expect(treeView.find('.selected').length).toBe 1
-      expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/sample.txt')
+      expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/tree-view/tree-view.txt')
       expect(rootView.getActiveEditor().isFocused).toBeFalsy()
 
   describe "when a file is double-clicked", ->
     it "selects the file and opens it in the active editor on the first click, then changes focus to the active editor on the second", ->
       sampleJs.trigger clickEvent(originalEvent: { detail: 1 })
       expect(sampleJs).toHaveClass 'selected'
-      expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/sample.js')
+      expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/tree-view/tree-view.js')
       expect(rootView.getActiveEditor().isFocused).toBeFalsy()
 
       sampleJs.trigger clickEvent(originalEvent: { detail: 2 })
@@ -288,15 +288,15 @@ describe "TreeView", ->
   describe "when a new file is opened in the active editor", ->
     it "is selected in the tree view if the file's entry visible", ->
       sampleJs.click()
-      rootView.open(require.resolve('fixtures/sample.txt'))
+      rootView.open(require.resolve('fixtures/tree-view/tree-view.txt'))
 
       expect(sampleTxt).toHaveClass 'selected'
       expect(treeView.find('.selected').length).toBe 1
 
     it "selected a file's parent dir if the file's entry is not visible", ->
-      rootView.open(require.resolve('fixtures/dir/a-dir/oh-git'))
+      rootView.open(require.resolve('fixtures/tree-view/dir1/sub-dir1/sub-file1'))
 
-      dirView = treeView.root.find('.directory:contains(dir)').view()
+      dirView = treeView.root.find('.directory:contains(dir1)').view()
       expect(dirView).toHaveClass 'selected'
 
   describe "when a different editor becomes active", ->
@@ -346,7 +346,7 @@ describe "TreeView", ->
 
         beforeEach ->
           nested = treeView.root.find('.directory:eq(2)').view()
-          expect(nested.find('.header').text()).toContain 'nested'
+          expect(nested.find('.header').text()).toContain 'nested/'
           nested.expand()
           nested2 = nested.entries.find('.entry:last').view()
           nested2.click()
@@ -485,9 +485,9 @@ describe "TreeView", ->
     describe "tree-view:open-selected-entry", ->
       describe "when a file is selected", ->
         it "opens the file in the editor and focuses it", ->
-          treeView.root.find('.file:contains(sample.js)').click()
+          treeView.root.find('.file:contains(tree-view.js)').click()
           treeView.root.trigger 'tree-view:open-selected-entry'
-          expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/sample.js')
+          expect(rootView.getActiveEditor().getPath()).toBe require.resolve('fixtures/tree-view/tree-view.js')
           expect(rootView.getActiveEditor().isFocused).toBeTruthy()
 
       describe "when a directory is selected", ->
@@ -736,7 +736,7 @@ describe "TreeView", ->
     temporaryFilePath = null
 
     beforeEach ->
-      temporaryFilePath = fs.join(require.resolve('fixtures'), 'temporary')
+      temporaryFilePath = fs.join(require.resolve('fixtures/tree-view'), 'temporary')
       if fs.exists(temporaryFilePath)
         fs.remove(temporaryFilePath)
         waits(20)
diff --git a/spec/fixtures/nested/nested2/.gitkeep b/spec/fixtures/tree-view/dir1/file1
similarity index 100%
rename from spec/fixtures/nested/nested2/.gitkeep
rename to spec/fixtures/tree-view/dir1/file1
diff --git a/spec/fixtures/tree-view/dir1/sub-dir1/sub-file1 b/spec/fixtures/tree-view/dir1/sub-dir1/sub-file1
new file mode 100644
index 000000000..e69de29bb
diff --git a/spec/fixtures/tree-view/dir2/file2 b/spec/fixtures/tree-view/dir2/file2
new file mode 100644
index 000000000..e69de29bb
diff --git a/spec/fixtures/tree-view/nested/nested2/.gitkeep b/spec/fixtures/tree-view/nested/nested2/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/spec/fixtures/tree-view/tree-view.js b/spec/fixtures/tree-view/tree-view.js
new file mode 100644
index 000000000..fb33b0b43
--- /dev/null
+++ b/spec/fixtures/tree-view/tree-view.js
@@ -0,0 +1,13 @@
+var quicksort = function () {
+  var sort = function(items) {
+    if (items.length <= 1) return items;
+    var pivot = items.shift(), current, left = [], right = [];
+    while(items.length > 0) {
+      current = items.shift();
+      current < pivot ? left.push(current) : right.push(current);
+    }
+    return sort(left).concat(pivot).concat(sort(right));
+  };
+
+  return sort(Array.apply(this, arguments));
+};
\ No newline at end of file
diff --git a/spec/fixtures/tree-view/tree-view.txt b/spec/fixtures/tree-view/tree-view.txt
new file mode 100644
index 000000000..3e715502b
--- /dev/null
+++ b/spec/fixtures/tree-view/tree-view.txt
@@ -0,0 +1 @@
+Some text.
diff --git a/spec/stdlib/fs-spec.coffee b/spec/stdlib/fs-spec.coffee
index 30bd57e25..248762ffe 100644
--- a/spec/stdlib/fs-spec.coffee
+++ b/spec/stdlib/fs-spec.coffee
@@ -83,7 +83,7 @@ describe "fs", ->
 
       expect(paths.length).toBeGreaterThan 0
       for path in paths
-        expect(path).not.toMatch /dir/
+        expect(path).not.toMatch /\/dir$/
 
   describe ".lastModified(path)", ->
     it "returns a Date object representing the time the file was last modified", ->

From f51c5dffedd93dea758bb5db61df37829d5c312a Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Mon, 1 Oct 2012 22:50:17 -0700
Subject: [PATCH 45/72] Include trailing slash when checking for dir segment

---
 spec/stdlib/fs-spec.coffee | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/stdlib/fs-spec.coffee b/spec/stdlib/fs-spec.coffee
index 248762ffe..d19c2f253 100644
--- a/spec/stdlib/fs-spec.coffee
+++ b/spec/stdlib/fs-spec.coffee
@@ -83,7 +83,7 @@ describe "fs", ->
 
       expect(paths.length).toBeGreaterThan 0
       for path in paths
-        expect(path).not.toMatch /\/dir$/
+        expect(path).not.toMatch /\/dir\//
 
   describe ".lastModified(path)", ->
     it "returns a Date object representing the time the file was last modified", ->

From 189e3be5aee775bb97170e57caa34199becce14f Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Tue, 2 Oct 2012 10:39:35 -0700
Subject: [PATCH 46/72] Wrap around fuzzy finder when at top or bottom

---
 spec/extensions/fuzzy-finder-spec.coffee      | 11 ++++-----
 .../fuzzy-finder/fuzzy-finder.coffee          | 24 +++++++++++--------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/spec/extensions/fuzzy-finder-spec.coffee b/spec/extensions/fuzzy-finder-spec.coffee
index d5b2d6552..fd1b3e774 100644
--- a/spec/extensions/fuzzy-finder-spec.coffee
+++ b/spec/extensions/fuzzy-finder-spec.coffee
@@ -223,16 +223,15 @@ describe 'FuzzyFinder', ->
         expect(finder.find('li:eq(1)')).toHaveClass "selected"
         expect(finder.find('li:eq(2)')).not.toHaveClass "selected"
 
-      it "does not fall off the end or begining of the list", ->
+      it "wraps around when at the end or begining of the list", ->
         expect(finder.find('li:first')).toHaveClass "selected"
+
         finder.miniEditor.trigger keydownEvent('up')
-        expect(finder.find('li:first')).toHaveClass "selected"
-
-        for i in [1..finder.pathList.children().length+2]
-          finder.miniEditor.trigger keydownEvent('down')
-
         expect(finder.find('li:last')).toHaveClass "selected"
 
+        finder.miniEditor.trigger keydownEvent('down')
+        expect(finder.find('li:first')).toHaveClass "selected"
+
     describe "when the fuzzy finder loses focus", ->
       it "detaches itself", ->
         rootView.attachToDom()
diff --git a/src/extensions/fuzzy-finder/fuzzy-finder.coffee b/src/extensions/fuzzy-finder/fuzzy-finder.coffee
index f016017f1..70206338b 100644
--- a/src/extensions/fuzzy-finder/fuzzy-finder.coffee
+++ b/src/extensions/fuzzy-finder/fuzzy-finder.coffee
@@ -93,18 +93,22 @@ class FuzzyFinder extends View
     false
 
   moveUp: ->
-    @findSelectedLi()
-      .filter(':not(:first-child)')
-      .removeClass('selected')
-      .prev()
-      .addClass('selected')
+    selected = @findSelectedLi().removeClass('selected')
+
+    if selected.filter(':not(:first-child)').length is 0
+      selected = @pathList.children('li:last')
+    else
+      selected = selected.prev()
+    selected.addClass('selected')
 
   moveDown: ->
-    @findSelectedLi()
-      .filter(':not(:last-child)')
-      .removeClass('selected')
-      .next()
-      .addClass('selected')
+    selected = @findSelectedLi().removeClass('selected')
+
+    if selected.filter(':not(:last-child)').length is 0
+      selected = @pathList.children('li:first')
+    else
+      selected = selected.next()
+    selected.addClass('selected')
 
   findMatches: (query) ->
     fuzzyFilter(@paths, query, maxResults: @maxResults)

From 8cb84f71eb5ee4c8768c31a0c3c975253e7364e1 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Tue, 2 Oct 2012 10:43:49 -0700
Subject: [PATCH 47/72] Add wrap guide and markdown preview to default config

---
 .atom/default-config.coffee | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.atom/default-config.coffee b/.atom/default-config.coffee
index 6e5f185fd..50661bcd8 100644
--- a/.atom/default-config.coffee
+++ b/.atom/default-config.coffee
@@ -6,4 +6,5 @@ requireExtension 'command-panel'
 requireExtension 'keybindings-view'
 requireExtension 'snippets'
 requireExtension 'status-bar'
-
+requireExtension 'wrap-guide'
+requireExtension 'markdown-preview'

From cc90d699750d4a7ead4e3df92e51983272272764 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Tue, 2 Oct 2012 10:46:14 -0700
Subject: [PATCH 48/72] Remove unused variable

---
 src/extensions/markdown-preview/markdown-preview.coffee | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/extensions/markdown-preview/markdown-preview.coffee b/src/extensions/markdown-preview/markdown-preview.coffee
index 2785610a3..8601b8b85 100644
--- a/src/extensions/markdown-preview/markdown-preview.coffee
+++ b/src/extensions/markdown-preview/markdown-preview.coffee
@@ -1,4 +1,4 @@
-{View, $$} = require 'space-pen'
+{View} = require 'space-pen'
 fs = require 'fs'
 $ = require 'jquery'
 

From 282802ac6c62861866257e695cadc5f2891ad0d9 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki 
Date: Tue, 2 Oct 2012 12:51:06 -0700
Subject: [PATCH 49/72] Scroll auto complete view with editor window

---
 src/app/editor.coffee                           | 9 ++++++---
 src/extensions/autocomplete/autocomplete.coffee | 8 ++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/app/editor.coffee b/src/app/editor.coffee
index f74693356..bbac15e95 100644
--- a/src/app/editor.coffee
+++ b/src/app/editor.coffee
@@ -646,7 +646,7 @@ class Editor extends View
   addCursorView: (cursor) ->
     cursorView = new CursorView(cursor, this)
     @cursorViews.push(cursorView)
-    @renderedLines.append(cursorView)
+    @appendToLinesView(cursorView)
     cursorView
 
   removeCursorView: (cursorView) ->
@@ -670,7 +670,7 @@ class Editor extends View
   addSelectionView: (selection) ->
     selectionView = new SelectionView({editor: this, selection})
     @selectionViews.push(selectionView)
-    @renderedLines.append(selectionView)
+    @appendToLinesView(selectionView)
     selectionView
 
   removeSelectionView: (selectionView) ->
@@ -680,9 +680,12 @@ class Editor extends View
     cursorView.remove() for cursorView in @getCursorViews()
     selectionView.remove() for selectionView in @getSelectionViews()
 
+  appendToLinesView: (view) ->
+    @renderedLines.append(view)
+
   calculateDimensions: ->
     fragment = $('