Closed wrick17 closed 9 years ago
Steps to reproduce:
Hello all,
I corrected this issue by modifing the terminalMousewheel event in lib/termk-view.coffee file, as follows:
terminalMousewheel: (event) =>
deltaY = event.wheelDeltaY
#This line breaks things on OS X
#deltaY/120 is not needed for scrolling
#deltaY /= 120
deltaY *= -1
@terminal.scrollDisp(deltaY)
I still get this error when attempting to scroll up to the previous text.
Hey @ZachR0, I tried your fix, but it still throws the same error for me. any idea what might be the problem?
@basheps @wrick17 I have not tested this fix outside of OS X; From what I can tell, the way that the delta Y values from the "mouse wheel" are being used is causing the problem. Depending on your operating system, the way in which this value is interpreted varies. If this is the case, the way this mouse event is handled needs to be universal.
Mozilla has some good documentation talking about these delta values - https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel
After you two made these changes, did you close and re-open Atom? Also, what operating system are you using?
@basheps @wrick17 This solution works for me as well, does it work on your end? I changed how scrolling was handled -- I pretty much looked how term.js does it, and converted it over to CoffeeScript.
terminalMousewheel: (event) =>
#This breaks everything :(
#deltaY = event.wheelDeltaY
#deltaY /= 120
#deltaY *= -1
#Works on OSX only?
#deltaY = event.wheelDeltaY
#deltaY *= -1
#Possible catch-all solution?
deltaY = event.wheelDeltaY
#Handle scrolling based on the event type
#Based on how term.js handles mouse scrolling
if event.type is 'DOMMouseScroll'
deltaY += if event.detail < 0 then -1 else 1
deltaY *= -1 #Correct scrolling direction
else
deltaY += if event.wheelDeltaY > 0 then -1 else 1
deltaY *= -1 #Correct scrolling direction
@terminal.scrollDisp(deltaY)
Closing in favor of https://github.com/romgrk/termrk/issues/27.
[Enter steps to reproduce below:]
Atom Version: 1.0.0 System: Mac OS X 10.10.3 Thrown From: Termrk package, v0.1.17
Stack Trace
Uncaught TypeError: Cannot read property '0' of undefined
Commands
Config
Installed Packages