diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java index fda9ee1622d0..523683496154 100644 --- a/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java +++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java @@ -15,6 +15,9 @@ */ package com.intellij.ui.tabs.impl; +import com.intellij.ide.IdeBundle; +import com.intellij.ide.ui.UISettings; +import com.intellij.openapi.ui.Messages; import com.intellij.ui.InplaceButton; import com.intellij.ui.MouseDragHelper; import com.intellij.ui.ScreenUtil; @@ -224,6 +227,24 @@ class DragHelper extends MouseDragHelper { super.processDragFinish(event, willDragOutStart); endDrag(willDragOutStart); + + final int place = UISettings.getInstance().EDITOR_TAB_PLACEMENT; + + if (!willDragOutStart && JBEditorTabs.isAlphabeticalMode() && place != SwingConstants.TOP && place != SwingConstants.BOTTOM) { + final Point p = new Point(event.getPoint()); + SwingUtilities.convertPoint(event.getComponent(), p, myTabs); + if (myTabs.getVisibleRect().contains(p)) { + final int answer = Messages.showOkCancelDialog(myTabs, + IdeBundle.message("alphabetical.mode.is.on.warning"), + IdeBundle.message("title.warning"), + Messages.getQuestionIcon()); + if (answer == Messages.OK) { + JBEditorTabs.setAlphabeticalMode(false); + myTabs.relayout(true, false); + myTabs.revalidate(); + } + } + } } private void endDrag(boolean willDragOutStart) { diff --git a/platform/platform-resources-en/src/messages/IdeBundle.properties b/platform/platform-resources-en/src/messages/IdeBundle.properties index ddc8b0a6b28d..8e70e76ae95f 100644 --- a/platform/platform-resources-en/src/messages/IdeBundle.properties +++ b/platform/platform-resources-en/src/messages/IdeBundle.properties @@ -1091,4 +1091,5 @@ diff.dialog.title=Diff Between ''{0}'' and ''{1}'' goto.custom.region.command=Go to Custom Region goto.custom.region.message.dumb.mode=Go to Custom Region action is not available until indices are built. -goto.custom.region.message.unavailable=There are no custom folding regions in the current file. \ No newline at end of file +goto.custom.region.message.unavailable=There are no custom folding regions in the current file. +alphabetical.mode.is.on.warning=Alphabetical order for tabs is ON. Switch it OFF? \ No newline at end of file