Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for deprecated getScrollTop call. Fixes issue 36. #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samhiatt
Copy link

This fixes issue 36.

I was added a workaround by adding a check to see if the function getScrollTop is defined, falling back on the old api if not. Not sure why the 'editor' passed into getEditorPositionFromEvent sometimes uses the old api, and sometimes uses the new one. This workaround accommodates both cases.

Thanks to this comment on issue 170 at ionide

You have to use editor.getScrollTop() instead of editor.displayBuffer.getScrollTop() in the definiton of bufferPositionFromMouseEvent, because getScrollTop has moved from DisplayBuffer to TextEditorElement since atom/atom@535a9da.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught TypeError: editor.element.getScrollTop is not a function
1 participant