mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CPP-4184 Generate multiple '}' on enter for code with several '{' in one line (method rename)
This commit is contained in:
+3
-2
@@ -67,7 +67,7 @@ public class EnterAfterUnmatchedBraceHandler extends EnterHandlerDelegateAdapter
|
||||
insertRBraces(file, editor,
|
||||
caretOffset,
|
||||
getRBraceOffset(file, editor, caretOffset),
|
||||
adjustRBraceCountForPosition(editor, caretOffset, maxRBraceCount));
|
||||
generateStringToInsert(editor, caretOffset, maxRBraceCount));
|
||||
return Result.DefaultForceIndent;
|
||||
}
|
||||
return Result.Continue;
|
||||
@@ -110,7 +110,8 @@ public class EnterAfterUnmatchedBraceHandler extends EnterHandlerDelegateAdapter
|
||||
* @param maxRBraceCount the maximum number of '}' for insert at position, it always positive
|
||||
* @return the string of '}' that has to be inserted by handler, it must have at least one '}'
|
||||
*/
|
||||
protected String adjustRBraceCountForPosition(@NotNull final Editor editor, int caretOffset, int maxRBraceCount) {
|
||||
@NotNull
|
||||
protected String generateStringToInsert(@NotNull final Editor editor, int caretOffset, int maxRBraceCount) {
|
||||
assert maxRBraceCount > 0;
|
||||
|
||||
CharSequence text = editor.getDocument().getCharsSequence();
|
||||
|
||||
Reference in New Issue
Block a user