mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
improved reflow for ReStructredText
This commit is contained in:
+6
-2
@@ -118,7 +118,7 @@ public class ParagraphFillHandler {
|
||||
PsiElement prevSibling = element.getPrevSibling();
|
||||
PsiElement result = element;
|
||||
while (prevSibling != null && (prevSibling.getNode().getElementType().equals(elementType) ||
|
||||
(prevSibling instanceof PsiWhiteSpace &&
|
||||
(atWhitespaceToken(prevSibling) &&
|
||||
StringUtil.countChars(prevSibling.getText(), '\n') <= 1))) {
|
||||
final String text = prevSibling.getText();
|
||||
if (prevSibling.getNode().getElementType().equals(elementType) && StringUtil.isEmptyOrSpaces(
|
||||
@@ -138,7 +138,7 @@ public class ParagraphFillHandler {
|
||||
PsiElement nextSibling = element.getNextSibling();
|
||||
PsiElement result = element;
|
||||
while (nextSibling != null && (nextSibling.getNode().getElementType().equals(elementType) ||
|
||||
(nextSibling instanceof PsiWhiteSpace &&
|
||||
(atWhitespaceToken(nextSibling) &&
|
||||
StringUtil.countChars(nextSibling.getText(), '\n') <= 1))) {
|
||||
final String text = nextSibling.getText();
|
||||
if (nextSibling.getNode().getElementType().equals(elementType) && StringUtil.isEmptyOrSpaces(
|
||||
@@ -152,6 +152,10 @@ public class ParagraphFillHandler {
|
||||
return result;
|
||||
}
|
||||
|
||||
protected boolean atWhitespaceToken(@Nullable final PsiElement element) {
|
||||
return element instanceof PsiWhiteSpace;
|
||||
}
|
||||
|
||||
protected boolean isAvailableForElement(@Nullable final PsiElement element) {
|
||||
return element != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user