From f8026bb0059177e65bcd47a6c9251b23322d2123 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Tue, 29 Jul 2014 13:58:27 -0700 Subject: [PATCH] Require the react-editor-view where we require the editor-view --- exports/atom.coffee | 5 +---- spec/spec-helper.coffee | 2 +- spec/workspace-view-spec.coffee | 2 +- src/atom.coffee | 2 +- src/editor.coffee | 5 +---- src/react-editor-view.coffee | 18 ++++++++++++++++++ src/select-list-view.coffee | 5 +---- src/workspace-view.coffee | 1 - 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/exports/atom.coffee b/exports/atom.coffee index a536de48d..09920eff1 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -15,10 +15,7 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE module.exports.$ = $ module.exports.$$ = $$ module.exports.$$$ = $$$ - if atom.config.get('core.useReactMiniEditors') - module.exports.EditorView = require '../src/react-editor-view' - else - module.exports.EditorView = require '../src/editor-view' + module.exports.EditorView = require '../src/react-editor-view' module.exports.ScrollView = require '../src/scroll-view' module.exports.SelectListView = require '../src/select-list-view' module.exports.Task = require '../src/task' diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 79f2e5a06..7800cb5be 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -13,7 +13,7 @@ Config = require '../src/config' {Point} = require 'text-buffer' Project = require '../src/project' Editor = require '../src/editor' -EditorView = require '../src/editor-view' +EditorView = require '../src/react-editor-view' TokenizedBuffer = require '../src/tokenized-buffer' EditorComponent = require '../src/editor-component' pathwatcher = require 'pathwatcher' diff --git a/spec/workspace-view-spec.coffee b/spec/workspace-view-spec.coffee index c6aa502b3..f95a52dc3 100644 --- a/spec/workspace-view-spec.coffee +++ b/spec/workspace-view-spec.coffee @@ -2,7 +2,7 @@ Q = require 'q' path = require 'path' temp = require 'temp' -EditorView = require '../src/editor-view' +EditorView = require '../src/react-editor-view' PaneView = require '../src/pane-view' Workspace = require '../src/workspace' diff --git a/src/atom.coffee b/src/atom.coffee index 4c2da7f8a..8b408ee2a 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -303,7 +303,7 @@ class Atom extends Model dimensions = @restoreWindowDimensions() @config.load() @config.setDefaults('core', require('./workspace-view').configDefaults) - @config.setDefaults('editor', require('./editor-view').configDefaults) + @config.setDefaults('editor', require('./react-editor-view').configDefaults) @keymaps.loadBundledKeymaps() @themes.loadBaseStylesheets() @packages.loadPackages() diff --git a/src/editor.coffee b/src/editor.coffee index 451e84b0c..eccf9d6cf 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -235,10 +235,7 @@ class Editor extends Model @subscribe @displayBuffer, "character-widths-changed", (changeCount) => @emit 'character-widths-changed', changeCount getViewClass: -> - if atom.config.get('core.useReactEditor') - require './react-editor-view' - else - require './editor-view' + require './react-editor-view' destroyed: -> @unsubscribe() diff --git a/src/react-editor-view.coffee b/src/react-editor-view.coffee index 643b58f07..36c0cbd7c 100644 --- a/src/react-editor-view.coffee +++ b/src/react-editor-view.coffee @@ -7,6 +7,24 @@ EditorComponent = require './editor-component' module.exports = class ReactEditorView extends View + @configDefaults: + fontFamily: '' + fontSize: 16 + lineHeight: 1.3 + showInvisibles: false + showIndentGuide: false + showLineNumbers: true + autoIndent: true + normalizeIndentOnPaste: true + nonWordCharacters: "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-" + preferredLineLength: 80 + tabLength: 2 + softWrap: false + softTabs: true + softWrapAtPreferredLineLength: false + scrollSensitivity: 40 + useHardwareAcceleration: true + @content: (params) -> attributes = params.attributes ? {} attributes.class = 'editor react editor-colors' diff --git a/src/select-list-view.coffee b/src/select-list-view.coffee index 8776b2757..bf279df45 100644 --- a/src/select-list-view.coffee +++ b/src/select-list-view.coffee @@ -1,8 +1,5 @@ {$, View} = require './space-pen-extensions' -if atom.config.get('core.useReactMiniEditors') - EditorView = require './react-editor-view' -else - EditorView = require './editor-view' +EditorView = require './react-editor-view' fuzzyFilter = require('fuzzaldrin').filter # Public: Provides a view that renders a list of items with an editor that diff --git a/src/workspace-view.coffee b/src/workspace-view.coffee index 8e3af09d0..b32499f57 100644 --- a/src/workspace-view.coffee +++ b/src/workspace-view.coffee @@ -9,7 +9,6 @@ scrollbarStyle = require 'scrollbar-style' fs = require 'fs-plus' Workspace = require './workspace' CommandInstaller = require './command-installer' -EditorView = require './editor-view' PaneView = require './pane-view' PaneColumnView = require './pane-column-view' PaneRowView = require './pane-row-view'