Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 8c22362

Browse files
committed
Merge pull request #5428 from SAPlayer/quickview-fix
Fix for #5426 (Quick View popup closes & reopens when moving mouse rightward)
2 parents 82380f4 + bc97f19 commit 8c22362

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • src/extensions/default/QuickView

src/extensions/default/QuickView/main.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -594,10 +594,16 @@ define(function (require, exports, module) {
594594
}
595595
lastPos = pos;
596596

597+
// No preview if mouse is past last char on line
598+
if (pos.ch >= editor.document.getLine(pos.line).length) {
599+
hidePreview();
600+
return;
601+
}
602+
597603
// Is there already a popover provider and range?
598604
if (popoverState) {
599605
if (popoverState.start && popoverState.end &&
600-
editor.posWithinRange(pos, popoverState.start, popoverState.end)) {
606+
editor.posWithinRange(pos, popoverState.start, popoverState.end, 1)) {
601607
// That one's still relevant - nothing more to do
602608
return;
603609
} else {
@@ -607,12 +613,6 @@ define(function (require, exports, module) {
607613
}
608614
}
609615

610-
// No preview if mouse is past last char on line
611-
if (pos.ch >= editor.document.getLine(pos.line).length) {
612-
hidePreview();
613-
return;
614-
}
615-
616616
// Initialize popoverState
617617
popoverState = {};
618618

0 commit comments

Comments
 (0)