mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Limit text we are showing when suggesting text of long and multiline expressions (IDEA-56847)
This commit is contained in:
@@ -64,7 +64,11 @@ public class IntroduceTargetChooser {
|
||||
|
||||
final T expr = (T)value;
|
||||
if (expr.isValid()) {
|
||||
setText(renderer.fun(expr));
|
||||
String text = renderer.fun(expr);
|
||||
int firstNewLinePos = text.indexOf('\n');
|
||||
String trimmedText = text.substring(0, firstNewLinePos != -1 ? firstNewLinePos : Math.min(100, text.length()));
|
||||
if (trimmedText.length() != text.length()) trimmedText += " ...";
|
||||
setText(trimmedText);
|
||||
}
|
||||
return rendererComponent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user