-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
fix: bug in guttertooltip when tooltipsFollowsMouse
set to false
#5217
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5217 +/- ##
==========================================
+ Coverage 87.22% 87.24% +0.01%
==========================================
Files 565 565
Lines 45253 45283 +30
Branches 6927 6928 +1
==========================================
+ Hits 39471 39505 +34
+ Misses 5782 5778 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
tooltipsFollowsMouse
tooltipsFollowsMouse
set to false
src/layer/lines.js
Outdated
@@ -42,6 +42,15 @@ class Lines { | |||
get(index) { | |||
return this.cells[index]; | |||
} | |||
|
|||
getCellAtRow(row) { | |||
for (var i = 0; i < this.getLength(); i++){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be a binary search right? or maybe something faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the implementation of the search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation is changed to not use any search anymore
src/mouse/mouse_event.js
Outdated
* @return {Number} 'row' within the gutter. | ||
*/ | ||
getGutterRow() { | ||
var documentRow = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY).row; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to use this.getDocumentPosition().row
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah, good catch, changed
Issue #, if available: NA
Fixes a bug where an error is thrown when hovering over the gutter with
tooltipsFollowsMouse == true
and scrolled. Additionally, addstooltipsFollowsMouse
to kitchen-sink to make it easier to test this option.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.