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

fix: bug in guttertooltip when tooltipsFollowsMouse set to false #5217

Merged
merged 16 commits into from
Jul 5, 2023

Conversation

akoreman
Copy link
Contributor

Issue #, if available: NA

Fixes a bug where an error is thrown when hovering over the gutter with tooltipsFollowsMouse == true and scrolled. Additionally, adds tooltipsFollowsMouse 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.

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch coverage: 97.14% and project coverage change: +0.01 🎉

Comparison is base (a6c8bf3) 87.22% compared to head (6dcb1cb) 87.24%.

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     
Flag Coverage Δ
unittests 87.24% <97.14%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/mouse/default_gutter_handler.js 76.31% <88.88%> (+3.34%) ⬆️
src/mouse/default_gutter_handler_test.js 99.46% <100.00%> (+0.06%) ⬆️
src/mouse/mouse_event.js 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@akoreman akoreman changed the title fix: bug in guttertooltip when tooltipsFollowsMouse fix: bug in guttertooltip when tooltipsFollowsMouse set to false Jun 27, 2023
@@ -42,6 +42,15 @@ class Lines {
get(index) {
return this.cells[index];
}

getCellAtRow(row) {
for (var i = 0; i < this.getLength(); i++){
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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

* @return {Number} 'row' within the gutter.
*/
getGutterRow() {
var documentRow = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY).row;
Copy link
Contributor

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

Copy link
Contributor Author

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

@akoreman akoreman merged commit 67d318e into ajaxorg:master Jul 5, 2023
3 checks passed
@akoreman akoreman deleted the tooltip_fix branch July 5, 2023 12:23
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.

None yet

3 participants