Manage scroll sensitivity setting in TextEditorRegistry

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Max Brunsfeld
2016-07-27 15:39:03 -07:00
committed by Nathan Sobo
parent 63a730253b
commit ab30ecf994
2 changed files with 11 additions and 1 deletions

View File

@@ -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'})

View File

@@ -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()