From 424652e27c7a21ad276d01e912e1827cf9f7d412 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 21 Mar 2014 17:33:39 -0600 Subject: [PATCH 01/19] Also ensure editor is *visible* before recalculating dimensions --- src/editor-view.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 075284019..a2148516e 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -885,7 +885,7 @@ class EditorView extends View @setHeightInLines() recalculateDimensions: -> - return unless @attached + return unless @attached and @isVisible() oldCharWidth = @charWidth oldLineHeight = @lineHeight From 810ca750cd59c2e81b6fecbc483a9e48968fe688 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 24 Mar 2014 17:19:43 +0800 Subject: [PATCH 02/19] Upgrade to atom-shell@0.11.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cbf421ef5..eca939ee8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "All Rights Reserved", - "atomShellVersion": "0.11.1", + "atomShellVersion": "0.11.2", "dependencies": { "async": "0.2.6", "atom-keymap": "^0.10.0", From 4e3a46ee71062f102dbf15b01932009197ecb17d Mon Sep 17 00:00:00 2001 From: probablycorey Date: Mon, 24 Mar 2014 09:12:59 -0700 Subject: [PATCH 03/19] Use correct keybinding for window:reload --- docs/creating-a-theme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/creating-a-theme.md b/docs/creating-a-theme.md index a49924e9c..d8abea113 100644 --- a/docs/creating-a-theme.md +++ b/docs/creating-a-theme.md @@ -51,7 +51,7 @@ editor such as comments, strings and the line numbers in the gutter. As an example, let's make the `.gutter` `background-color` into `@red`. -Reload Atom by pressing `cmd-alt-option-L` to see the changes you made reflected +Reload Atom by pressing `cmd-alt-option-l` to see the changes you made reflected in your Atom window. Pretty neat! __Tip:__ You can avoid reloading to see changes you make by opening an atom From 98ea42d8080ba86242fd53f3ff30390d3bf96375 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Mon, 24 Mar 2014 09:38:40 -0700 Subject: [PATCH 04/19] Update docs on window:reloading --- docs/creating-a-theme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/creating-a-theme.md b/docs/creating-a-theme.md index d8abea113..7a527d1dc 100644 --- a/docs/creating-a-theme.md +++ b/docs/creating-a-theme.md @@ -51,7 +51,7 @@ editor such as comments, strings and the line numbers in the gutter. As an example, let's make the `.gutter` `background-color` into `@red`. -Reload Atom by pressing `cmd-alt-option-l` to see the changes you made reflected +Reload Atom by pressing `cmd-alt-ctrl-l` to see the changes you made reflected in your Atom window. Pretty neat! __Tip:__ You can avoid reloading to see changes you make by opening an atom From 023cb2ea55c112fb5e44ffad1b179ce9455e7102 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 24 Mar 2014 10:54:56 -0700 Subject: [PATCH 05/19] Prepare 0.77.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eca939ee8..da6d398bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "0.76.0", + "version": "0.77.0", "main": "./src/browser/main.js", "repository": { "type": "git", From 5eb12e671bf477d94e379fd1b3cc22e37aac3dd6 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Tue, 18 Mar 2014 15:57:53 -0700 Subject: [PATCH 06/19] add config option for explicitly setting the editor line height --- src/editor-view.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index a2148516e..8c58ded79 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -44,6 +44,7 @@ class EditorView extends View @configDefaults: fontFamily: '' fontSize: 16 + editorLineHeight: 1 showInvisibles: false showIndentGuide: false showLineNumbers: true @@ -340,6 +341,8 @@ class EditorView extends View @subscribe atom.config.observe 'editor.invisibles', (invisibles) => @setInvisibles(invisibles) @subscribe atom.config.observe 'editor.fontSize', (fontSize) => @setFontSize(fontSize) @subscribe atom.config.observe 'editor.fontFamily', (fontFamily) => @setFontFamily(fontFamily) + @subscribe atom.config.observe 'editor.editorLineHeight', (editorLineHeight) => @setEditorLineHeight(editorLineHeight) + handleEvents: -> @on 'focus', => @@ -742,6 +745,10 @@ class EditorView extends View @redraw() + setEditorLineHeight: (editorLineHeight) -> + @css('line-height', editorLineHeight) + @redraw() + # Public: Gets the font family for the editor. # # Returns a {String} identifying the CSS `font-family`. From 47f3b562b5300531fce842e1587451211d69299a Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Tue, 18 Mar 2014 16:03:42 -0700 Subject: [PATCH 07/19] add getter for editorLineHeight --- src/editor-view.coffee | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 8c58ded79..681e347b1 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -745,15 +745,25 @@ class EditorView extends View @redraw() - setEditorLineHeight: (editorLineHeight) -> - @css('line-height', editorLineHeight) - @redraw() - # Public: Gets the font family for the editor. # # Returns a {String} identifying the CSS `font-family`. getFontFamily: -> @css("font-family") + # Public: Sets the line height of the editor + # + # editorLineHeight - A {Number} without a unit suffix identifying the CSS + # `line-height`. + setEditorLineHeight: (editorLineHeight) -> + @css('line-height', editorLineHeight) + @redraw() + + # Public: Gets the line height for the editor + # + # Returns a {Float} identifying the CSS line-height. + getLineHeight: -> + parseFloat(@css('line-height')) + # Public: Redraw the editor redraw: -> return unless @hasParent() From 95d097dd7b2aaafc38e97f353cbc680e4c3274e9 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Tue, 18 Mar 2014 16:21:45 -0700 Subject: [PATCH 08/19] 1.3 best represents the previous default line height --- src/editor-view.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 681e347b1..abf47b036 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -44,7 +44,7 @@ class EditorView extends View @configDefaults: fontFamily: '' fontSize: 16 - editorLineHeight: 1 + editorLineHeight: 1.3 showInvisibles: false showIndentGuide: false showLineNumbers: true From d3d38c031271dc5d49b7abbb19f5b9155eb4a0f9 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Mon, 24 Mar 2014 11:28:15 -0700 Subject: [PATCH 09/19] rename editorLineHeight to lineHeight --- src/editor-view.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index abf47b036..5caa92918 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -44,7 +44,7 @@ class EditorView extends View @configDefaults: fontFamily: '' fontSize: 16 - editorLineHeight: 1.3 + lineHeight: 1.3 showInvisibles: false showIndentGuide: false showLineNumbers: true @@ -341,7 +341,7 @@ class EditorView extends View @subscribe atom.config.observe 'editor.invisibles', (invisibles) => @setInvisibles(invisibles) @subscribe atom.config.observe 'editor.fontSize', (fontSize) => @setFontSize(fontSize) @subscribe atom.config.observe 'editor.fontFamily', (fontFamily) => @setFontFamily(fontFamily) - @subscribe atom.config.observe 'editor.editorLineHeight', (editorLineHeight) => @setEditorLineHeight(editorLineHeight) + @subscribe atom.config.observe 'editor.lineHeight', (lineHeight) => @setLineHeight(lineHeight) handleEvents: -> @@ -752,10 +752,10 @@ class EditorView extends View # Public: Sets the line height of the editor # - # editorLineHeight - A {Number} without a unit suffix identifying the CSS + # lineHeight - A {Number} without a unit suffix identifying the CSS # `line-height`. - setEditorLineHeight: (editorLineHeight) -> - @css('line-height', editorLineHeight) + setLineHeight: (lineHeight) -> + @css('line-height', lineHeight) @redraw() # Public: Gets the line height for the editor From ce02dcf5a5e002e8b325dab38998c2d25cdc873a Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Mon, 24 Mar 2014 11:37:38 -0700 Subject: [PATCH 10/19] clarify docs around lineHeight --- src/editor-view.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 5caa92918..7b8ad82ab 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -760,6 +760,10 @@ class EditorView extends View # Public: Gets the line height for the editor # + # Note that this is different from `lineHeight`, which is the computed + # height of a line using the bounding box. This is the property value of + # CSS `line-height`. + # # Returns a {Float} identifying the CSS line-height. getLineHeight: -> parseFloat(@css('line-height')) From c389bccfa098e80150f606dead4eba90d51203bf Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Mon, 24 Mar 2014 11:37:58 -0700 Subject: [PATCH 11/19] update editor view specs to account for lineHeight --- spec/editor-view-spec.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/editor-view-spec.coffee b/spec/editor-view-spec.coffee index 9ef516613..26c52dbb5 100644 --- a/spec/editor-view-spec.coffee +++ b/spec/editor-view-spec.coffee @@ -2937,14 +2937,14 @@ describe "EditorView", -> .editor { line-height: 2; } """ - expect(editorView.pixelPositionForScreenPosition([1, 3])).toEqual {top: 32, left: 30} - expect(editorView.getCursorView().position()).toEqual {top: 32, left: 30} + expect(editorView.pixelPositionForScreenPosition([1, 3])).toEqual {top: 20, left: 30} + expect(editorView.getCursorView().position()).toEqual {top: 20, left: 30} atom.themes.applyStylesheet 'char-width', """ .editor { letter-spacing: 2px; } """ - expect(editorView.pixelPositionForScreenPosition([1, 3])).toEqual {top: 32, left: 36} - expect(editorView.getCursorView().position()).toEqual {top: 32, left: 36} + expect(editorView.pixelPositionForScreenPosition([1, 3])).toEqual {top: 20, left: 36} + expect(editorView.getCursorView().position()).toEqual {top: 20, left: 36} describe "when the editor contains hard tabs", -> it "correctly calculates the the position left for a column", -> From a604bfcdf1fbf54b860ca516b27812679abf37fa Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Mon, 24 Mar 2014 11:42:32 -0700 Subject: [PATCH 12/19] remove trailing whitespace --- src/editor-view.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 7b8ad82ab..152c46c35 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -762,7 +762,7 @@ class EditorView extends View # # Note that this is different from `lineHeight`, which is the computed # height of a line using the bounding box. This is the property value of - # CSS `line-height`. + # CSS `line-height`. # # Returns a {Float} identifying the CSS line-height. getLineHeight: -> From cf590685b9024d8734eef5a2789ea7556b36b6f3 Mon Sep 17 00:00:00 2001 From: Justin Palmer Date: Mon, 24 Mar 2014 12:52:01 -0700 Subject: [PATCH 13/19] remove lineHeight getter Nothing is using it and we can add it back once the need arises. --- src/editor-view.coffee | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index 152c46c35..ffd09dd92 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -758,16 +758,6 @@ class EditorView extends View @css('line-height', lineHeight) @redraw() - # Public: Gets the line height for the editor - # - # Note that this is different from `lineHeight`, which is the computed - # height of a line using the bounding box. This is the property value of - # CSS `line-height`. - # - # Returns a {Float} identifying the CSS line-height. - getLineHeight: -> - parseFloat(@css('line-height')) - # Public: Redraw the editor redraw: -> return unless @hasParent() From b5aefc6f5e3d5d59f13df2ab2b69c7dd219f19f1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 24 Mar 2014 12:53:50 -0700 Subject: [PATCH 14/19] Upgrade to language-gfm@0.25.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index da6d398bc..8fd045fbb 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "language-c": "0.13.0", "language-coffee-script": "0.16.0", "language-css": "0.13.0", - "language-gfm": "0.24.0", + "language-gfm": "0.25.0", "language-git": "0.9.0", "language-go": "0.7.0", "language-html": "0.15.0", From 66fa40b29e2b7a6dee06eeb89d8557483028eefc Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 24 Mar 2014 13:35:03 -0700 Subject: [PATCH 15/19] Upgrade to language-xml@0.9.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fd045fbb..45274c319 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "language-text": "0.6.0", "language-todo": "0.9.0", "language-toml": "0.12.0", - "language-xml": "0.8.0", + "language-xml": "0.9.0", "language-yaml": "0.6.0" }, "private": true, From 96503f74e453cc3f4a9122928b0f07273ef0421d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 24 Mar 2014 14:55:35 -0600 Subject: [PATCH 16/19] Upgrade to atom-keymap@0.11.0 for better native! handling We weren't clearing the queued keystrokes when aborting partial match due to encountering a native! binding. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45274c319..cd05b9de7 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "atomShellVersion": "0.11.2", "dependencies": { "async": "0.2.6", - "atom-keymap": "^0.10.0", + "atom-keymap": "^0.11.0", "bootstrap": "git://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372", "clear-cut": "0.4.0", "coffee-script": "1.7.0", From 22c8746ed6f7891226455cdc900f87b8302f6e00 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 24 Mar 2014 14:27:32 -0700 Subject: [PATCH 17/19] Upgrade to status-bar@0.37.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cd05b9de7..26d157ded 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "settings-view": "0.97.0", "snippets": "0.37.0", "spell-check": "0.28.0", - "status-bar": "0.36.0", + "status-bar": "0.37.0", "styleguide": "0.26.0", "symbols-view": "0.44.0", "tabs": "0.31.0", From ba8f6bccece59234a998fbf54aa6dd3ff0f643c4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 24 Mar 2014 15:13:53 -0700 Subject: [PATCH 18/19] Upgrade to snippets@0.38.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26d157ded..482ce582a 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "package-generator": "0.30.0", "release-notes": "0.26.0", "settings-view": "0.97.0", - "snippets": "0.37.0", + "snippets": "0.38.0", "spell-check": "0.28.0", "status-bar": "0.37.0", "styleguide": "0.26.0", From 1cdec9386c50b9b27461c768d07a8cfba864d026 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 24 Mar 2014 16:18:59 -0600 Subject: [PATCH 19/19] Modernize serialization docs --- docs/advanced/serialization.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/advanced/serialization.md b/docs/advanced/serialization.md index 282d9e358..c2a5f303a 100644 --- a/docs/advanced/serialization.md +++ b/docs/advanced/serialization.md @@ -19,7 +19,7 @@ module.exports = activate: (state) -> @myObject = if state - deserialize(state) + atom.deserializers.deserialize(state) else new MyObject("Hello") @@ -31,7 +31,8 @@ module.exports = ```coffee-script class MyObject - registerDeserializer(this) + atom.deserializers.add(this) + @deserialize: ({data}) -> new MyObject(data) constructor: (@data) -> serialize: -> { deserializer: 'MyObject', data: @data } @@ -50,8 +51,8 @@ class-level method on the same class that implements `serialize`. This method's job is to convert a state object returned from a previous call `serialize` back into a genuine object. -#### registerDeserializer(klass) -You need to call the global `registerDeserializer` method with your class in +#### atom.deserializers.add(klass) +You need to call the `atom.deserializers.add` method with your class in order to make it available to the deserialization system. Now you can call the global `deserialize` method with state returned from `serialize`, and your class's `deserialize` method will be selected automatically. @@ -60,14 +61,15 @@ class's `deserialize` method will be selected automatically. ```coffee-script class MyObject + atom.deserializers.add(this) + @version: 2 @deserialize: (state) -> ... - serialize: -> { version: MyObject.version, ... } + serialize: -> { version: @constructor.version, ... } ``` Your serializable class can optionally have a class-level `@version` property and include a `version` key in its serialized state. When deserializing, Atom will only attempt to call deserialize if the two versions match, and otherwise return undefined. We plan on implementing a migration system in the future, but -this at least protects you from improperly deserializing old state. If you find -yourself in dire need of the migration system, let us know. +this at least protects you from improperly deserializing old state.