Honor editor's scrollSensitivity parameter

This commit is contained in:
Antonio Scandurra
2017-08-15 12:22:59 +02:00
parent 756dad67d8
commit e980598aba
3 changed files with 24 additions and 25 deletions

View File

@@ -1486,7 +1486,7 @@ class TextEditorComponent {
}
didMouseWheel (event) {
const scrollSensitivity = this.props.mouseWheelScrollSensitivity || 0.8
const scrollSensitivity = this.props.model.getScrollSensitivity() / 100
let {deltaX, deltaY} = event
deltaX = deltaX * scrollSensitivity

View File

@@ -98,7 +98,6 @@ class TextEditor extends Model
registered: false
atomicSoftTabs: true
invisibles: null
scrollSensitivity: 40
Object.defineProperty @prototype, "element",
get: -> @getElement()
@@ -156,7 +155,7 @@ class TextEditor extends Model
@softTabs, @initialScrollTopRow, @initialScrollLeftColumn, initialLine, initialColumn, tabLength,
@softWrapped, @decorationManager, @selectionsMarkerLayer, @buffer, suppressCursorCreation,
@mini, @placeholderText, lineNumberGutterVisible, @showLineNumbers, @largeFileMode,
@assert, grammar, @showInvisibles, @autoHeight, @autoWidth, @scrollPastEnd, @editorWidthInChars,
@assert, grammar, @showInvisibles, @autoHeight, @autoWidth, @scrollPastEnd, @scrollSensitivity, @editorWidthInChars,
@tokenizedBuffer, @displayLayer, @invisibles, @showIndentGuide,
@softWrapped, @softWrapAtPreferredLineLength, @preferredLineLength,
@showCursorOnSelection
@@ -172,6 +171,7 @@ class TextEditor extends Model
@mini ?= false
@scrollPastEnd ?= false
@scrollSensitivity ?= 40
@showInvisibles ?= true
@softTabs ?= true
tabLength ?= 2