Skip to content

Commit 83439d5

Browse files
committed
Merge pull request #813 from SlavaRa/feature/refactoring_organize_imports
fixes: organize imports from one or more
2 parents a784156 + f9288fc commit 83439d5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

External/Plugins/CodeRefactor/PluginMain.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,11 @@ private void UpdateMenuItems()
346346
IASContext context = ASContext.Context;
347347
if (context != null && context.CurrentModel != null)
348348
{
349-
bool truncate = langIsValid && context.CurrentModel.Imports.Count > 0;
350-
bool organize = (langIsValid && context.CurrentModel.Imports.Count > 1);
351-
this.refactorContextMenu.OrganizeMenuItem.Enabled = organize;
352-
this.refactorContextMenu.TruncateMenuItem.Enabled = truncate;
353-
this.refactorMainMenu.OrganizeMenuItem.Enabled = organize;
354-
this.refactorMainMenu.TruncateMenuItem.Enabled = truncate;
349+
bool enabled = langIsValid && context.CurrentModel.Imports.Count > 0;
350+
this.refactorContextMenu.OrganizeMenuItem.Enabled = enabled;
351+
this.refactorContextMenu.TruncateMenuItem.Enabled = enabled;
352+
this.refactorMainMenu.OrganizeMenuItem.Enabled = enabled;
353+
this.refactorMainMenu.TruncateMenuItem.Enabled = enabled;
355354
}
356355
this.surroundContextMenu.Enabled = false;
357356
this.refactorMainMenu.SurroundMenu.Enabled = false;

0 commit comments

Comments
 (0)