Skip to content

Commit

Permalink
Find/Replace overlay: handle the case when moving editor between windows
Browse files Browse the repository at this point in the history
When moving the targeted editor between different windows, the overlay
is closed to allow a retargetting.

fixes #1945
  • Loading branch information
Wittmaxi committed Jun 10, 2024
1 parent 6d6465b commit d5d0b0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ private void showDialog() {
}

private void showOverlayInEditor() {
if (overlay == null) {
if (overlay == null || !overlay.isOverlayOpen()) {
Shell shellToUse = null;

if (fShell == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,10 @@ private void repositionTextSelection() {
}

private void positionToPart() {
if (!targetPart.getSite().getShell().equals(getShell().getParent())) {
close();
return;
}
getShell().requestLayout();
if (!(targetPart instanceof StatusTextEditor)) {
return;
Expand Down Expand Up @@ -863,4 +867,8 @@ private static boolean okayToUse(Widget widget) {
public void setPositionToTop(boolean shouldPositionOverlayOnTop) {
positionAtTop = shouldPositionOverlayOnTop;
}

public boolean isOverlayOpen() {
return overlayOpen;
}
}

0 comments on commit d5d0b0a

Please sign in to comment.