mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 00:57:59 +07:00
[java-injection] Fix handling of empty lines in text blocks
GitOrigin-RevId: e3887bb5c7504d925dab62be8b7182a654b2cc0c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
52f82c8921
commit
bee9170893
@@ -9,6 +9,7 @@ public class Hello {
|
||||
void test(@Subst("MyClass") String name, String message) {
|
||||
String s = JAVA."""
|
||||
import static java.lang.System.*;
|
||||
|
||||
class \{name} {
|
||||
private MyClass() {
|
||||
}
|
||||
|
||||
+1
@@ -9,6 +9,7 @@ public class Hello {
|
||||
void test(@Subst("MyClass") String name, String message) {
|
||||
String s = JAVA."""
|
||||
import static java.lang.System.*;
|
||||
|
||||
<caret>class \{name} {
|
||||
void main(int x) {
|
||||
if (x > 0) {
|
||||
|
||||
+3
-2
@@ -436,8 +436,9 @@ public final class ConcatenationInjector implements ConcatenationAwareInjector {
|
||||
while (endOffset > 0) {
|
||||
endOffset++;
|
||||
result.add(new TextRange(startOffset, endOffset));
|
||||
startOffset = endOffset + indent;
|
||||
endOffset = text.indexOf('\n', startOffset);
|
||||
int newEndOffset = text.indexOf('\n', endOffset);
|
||||
startOffset = Math.min(endOffset + indent, newEndOffset == -1 ? Integer.MAX_VALUE : newEndOffset);
|
||||
endOffset = newEndOffset;
|
||||
}
|
||||
endOffset = textRange.getEndOffset();
|
||||
if (startOffset <= endOffset) {
|
||||
|
||||
Reference in New Issue
Block a user