mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Merge branch 'dev' into user-prefs
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
|
||||
.editor .underlayer, .editor .lines, .editor .overlayer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
.editor {
|
||||
font-family: Inconsolata, Monaco, Courier;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.editor.mini {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
.editor {
|
||||
font-family: Inconsolata, Monaco, Courier;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.editor.mini {
|
||||
|
||||
Reference in New Issue
Block a user