From ab30ecf9943aef12f87df6e41424698ec24d4cab Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 27 Jul 2016 15:39:03 -0700 Subject: [PATCH] Manage scroll sensitivity setting in TextEditorRegistry Signed-off-by: Nathan Sobo --- spec/text-editor-registry-spec.js | 9 +++++++++ src/text-editor-registry.js | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-registry-spec.js b/spec/text-editor-registry-spec.js index 6d1aae2be..8ecb40c5b 100644 --- a/spec/text-editor-registry-spec.js +++ b/spec/text-editor-registry-spec.js @@ -427,6 +427,15 @@ describe('TextEditorRegistry', function () { expect(editor.getNonWordCharacters()).toBe('(){}[]') }) + it('sets the scroll sensitivity based on the config', function () { + atom.config.set('editor.scrollSensitivity', 60) + registry.maintainConfig(editor) + expect(editor.getScrollSensitivity()).toBe(60) + + atom.config.set('editor.scrollSensitivity', 70) + expect(editor.getScrollSensitivity()).toBe(70) + }) + it('gives the editor a scoped-settings delegate based on the config', function () { atom.config.set('editor.nonWordCharacters', '()') atom.config.set('editor.nonWordCharacters', '(){}', {scopeSelector: '.a.b .c.d'}) diff --git a/src/text-editor-registry.js b/src/text-editor-registry.js index e860ac9fd..825c4c58e 100644 --- a/src/text-editor-registry.js +++ b/src/text-editor-registry.js @@ -19,7 +19,8 @@ const EDITOR_SETTER_NAMES_BY_SETTING_KEY = [ ['editor.autoIndentOnPaste', 'setAutoIndentOnPaste'], ['editor.scrollPastEnd', 'setScrollPastEnd'], ['editor.undoGroupingInterval', 'setUndoGroupingInterval'], - ['editor.nonWordCharacters', 'setNonWordCharacters'] + ['editor.nonWordCharacters', 'setNonWordCharacters'], + ['editor.scrollSensitivity', 'setScrollSensitivity'] ] const GRAMMAR_SELECTION_RANGE = Range(Point.ZERO, Point(10, 0)).freeze()