eclipse 格式化数组初始化器的方式太可怕了。我知道您可以在首选项中调整它的格式,但它总是会在“=”和“{...}”之间添加一个换行符。
这对我来说看起来很丑陋,尤其是当你有一个空的初始化程序时。
有没有办法进一步调整这些设置,使其永远不会换行,或者它只是让数组初始化器单独存在,并且只在初始化器的逗号和元素之间放置适量的空格?
例如,这就是我想要的方式:
string shortArray[15] = { };
string notVeryLong[] = { "Some words", "More words", "and more", "etc" };
string TooLongForOneLine[] =
{
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc",
"Some words", "More words", "and more", "etc"
};