From 7e030b09e7a7da933b6f4931e73a40ae619b6a17 Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Wed, 30 Jan 2013 21:40:26 -0500 Subject: [PATCH 1/4] Adding a line-height to the editor. --- themes/Atom - Dark/editor.css | 1 + themes/Atom - Light/editor.css | 1 + 2 files changed, 2 insertions(+) diff --git a/themes/Atom - Dark/editor.css b/themes/Atom - Dark/editor.css index b2daa3586..533dca1b5 100644 --- a/themes/Atom - Dark/editor.css +++ b/themes/Atom - Dark/editor.css @@ -1,5 +1,6 @@ .editor { font-family: Inconsolata, Monaco, Courier; + line-height: 1.3; } .editor.mini { diff --git a/themes/Atom - Light/editor.css b/themes/Atom - Light/editor.css index 26dec9cb1..ac4a98014 100644 --- a/themes/Atom - Light/editor.css +++ b/themes/Atom - Light/editor.css @@ -1,5 +1,6 @@ .editor { font-family: Inconsolata, Monaco, Courier; + line-height: 1.3; } .editor.mini { From 11c0637220472f8cadcaf0b0d7653a7ccaad0d71 Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Thu, 31 Jan 2013 10:19:41 -0500 Subject: [PATCH 2/4] Not adding a font family when the user doesn't have it set --- spec/app/editor-spec.coffee | 7 +++---- src/app/editor.coffee | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 2cbc0cc34..2729be262 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -520,9 +520,8 @@ describe "Editor", -> beforeEach -> expect(editor.css('font-family')).not.toBe 'Courier' - it "sets the initial font family based on the value from config", -> - expect($("head style.font-family")).toExist() - expect($("head style.font-family").text()).toMatch "{font-family: #{config.get('editor.fontFamily')}}" + it "when there is no config in fontFamily don't set it", -> + expect($("head style.font-family")).not.toExist() describe "when the font family changes", -> it "updates the font family on new and existing editors", -> @@ -544,7 +543,7 @@ describe "Editor", -> lineHeightBefore = editor.lineHeight charWidthBefore = editor.charWidth - config.set("editor.fontFamily", "Courier") + config.set("editor.fontFamily", "Inconsolata") editor.setCursorScreenPosition [5, 6] expect(editor.charWidth).not.toBe charWidthBefore expect(editor.getCursorView().position()).toEqual { top: 5 * editor.lineHeight, left: 6 * editor.charWidth } diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 2769b6cba..e9a197158 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -14,7 +14,6 @@ _ = require 'underscore' module.exports = class Editor extends View @configDefaults: - fontFamily: "Inconsolata, Monaco, Courier" fontSize: 20 showInvisibles: false autosave: false @@ -697,6 +696,7 @@ class Editor extends View parseInt(@css("font-size")) setFontFamily: (fontFamily) -> + return if fontFamily == undefined headTag = $("head") styleTag = headTag.find("style.font-family") if styleTag.length == 0 From 4f8181969ed873f134a07259d4448624a1ef7f9e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 31 Jan 2013 09:24:59 -0800 Subject: [PATCH 3/4] :lipstick: --- static/editor.css | 1 - 1 file changed, 1 deletion(-) diff --git a/static/editor.css b/static/editor.css index 0b8cfb452..40c3d1b4e 100644 --- a/static/editor.css +++ b/static/editor.css @@ -56,7 +56,6 @@ overflow-x: hidden; } - .editor .underlayer, .editor .lines, .editor .overlayer { width: 100%; height: 100%; From ef6e525674def664631bf58af6e3ceafd192ef8e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 31 Jan 2013 09:32:20 -0800 Subject: [PATCH 4/4] Use package instead of package's view in specs Event logs are now stored on the package and passed to the view when toggled. --- .../command-logger/spec/command-logger-spec.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/packages/command-logger/spec/command-logger-spec.coffee b/src/packages/command-logger/spec/command-logger-spec.coffee index c01f24320..e2a06da2b 100644 --- a/src/packages/command-logger/spec/command-logger-spec.coffee +++ b/src/packages/command-logger/spec/command-logger-spec.coffee @@ -6,9 +6,8 @@ describe "CommandLogger", -> beforeEach -> rootView = new RootView(require.resolve('fixtures/sample.js')) - atom.loadPackage('command-logger').getInstance() + commandLogger = atom.loadPackage('command-logger') editor = rootView.getActiveEditor() - commandLogger = CommandLogger.instance afterEach -> rootView.deactivate() @@ -44,9 +43,11 @@ describe "CommandLogger", -> describe "when an event is ignored", -> it "does not create a node for that event", -> - commandLogger.ignoredEvents.push 'editor:delete-line' + commandLoggerView = commandLogger.getInstance() + commandLoggerView.ignoredEvents.push 'editor:delete-line' editor.trigger 'editor:delete-line' - nodes = commandLogger.createNodes() + commandLoggerView.eventLog = commandLogger.eventLog + nodes = commandLoggerView.createNodes() for node in nodes continue unless node.name is 'Editor' for child in node.children