mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-19 23:17:16 +03:00
Merge branch 'master' into dh-async-repo
This commit is contained in:
commit
b464916c56
@ -21,7 +21,12 @@
|
||||
# * https://atom.io/docs/latest/using-atom-basic-customization#customizing-key-bindings
|
||||
# * https://atom.io/docs/latest/behind-atom-keymaps-in-depth
|
||||
#
|
||||
# If you're having trouble with your keybindings not working, try the
|
||||
# Keybinding Resolver: `Cmd+.` on OS X and `Ctrl+.` on other platforms. See the
|
||||
# Debugging Guide for more information:
|
||||
# * https://atom.io/docs/latest/hacking-atom-debugging#check-the-keybindings
|
||||
#
|
||||
# This file uses CoffeeScript Object Notation (CSON).
|
||||
# If you are unfamiliar with CSON, you can read more about it in the
|
||||
# If you are unfamiliar with CSON, you can read more about it in the
|
||||
# Atom Flight Manual:
|
||||
# https://atom.io/docs/latest/using-atom-basic-customization#cson
|
||||
|
@ -782,6 +782,11 @@ describe "TextEditorPresenter", ->
|
||||
getState(presenter) # commits scroll position
|
||||
expect(editor.getFirstVisibleScreenRow()).toBe 6
|
||||
|
||||
it "updates when the model's scroll position is changed directly", ->
|
||||
presenter = buildPresenter(scrollTop: 0, explicitHeight: 20, horizontalScrollbarHeight: 10, lineHeight: 10)
|
||||
expectStateUpdate presenter, -> editor.setFirstVisibleScreenRow(1)
|
||||
expect(getState(presenter).content.scrollTop).toBe 10
|
||||
|
||||
it "reassigns the scrollTop if it exceeds the max possible value after lines are removed", ->
|
||||
presenter = buildPresenter(scrollTop: 80, lineHeight: 10, explicitHeight: 50, horizontalScrollbarHeight: 0)
|
||||
expect(getState(presenter).content.scrollTop).toBe(80)
|
||||
|
@ -1264,7 +1264,7 @@ class TextEditorPresenter
|
||||
@emitDidUpdateState()
|
||||
|
||||
didChangeFirstVisibleScreenRow: (screenRow) ->
|
||||
@updateScrollTop(screenRow * @lineHeight)
|
||||
@setScrollTop(screenRow * @lineHeight)
|
||||
|
||||
getVerticalScrollMarginInPixels: ->
|
||||
Math.round(@model.getVerticalScrollMargin() * @lineHeight)
|
||||
|
Loading…
Reference in New Issue
Block a user