mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[templates] generate child template name on copy (IDEA-298139)
GitOrigin-RevId: e2fd180f4b4ce703c72ca86bc670d7a7af9808ff
This commit is contained in:
committed by
intellij-monorepo-bot
parent
30c49600aa
commit
ea586482fd
+4
-1
@@ -153,7 +153,10 @@ public final class AllFileTemplatesConfigurable implements SearchableConfigurabl
|
||||
}
|
||||
@SuppressWarnings("UnresolvedPropertyKey")
|
||||
final String nameTemplate = IdeBundle.message("template.copy.N.of.T");
|
||||
String name = MessageFormat.format(nameTemplate, "", selected.getName());
|
||||
|
||||
String name = FileTemplateBase.isChild(selected) && selected instanceof FileTemplateBase
|
||||
? ((FileTemplateBase)selected).getChildName(selected.getChildren().length)
|
||||
: MessageFormat.format(nameTemplate, "", selected.getName());
|
||||
int i = 0;
|
||||
while (names.contains(name)) {
|
||||
name = MessageFormat.format(nameTemplate, ++i + " ", selected.getName());
|
||||
|
||||
Reference in New Issue
Block a user