mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[java-typing] Yet another fix for braces typing in string templates (IDEA-336810)
GitOrigin-RevId: 70895c6be623545585ecf7f01f02fda73db8eea8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
55fb552005
commit
8b1795dc3f
@@ -118,8 +118,9 @@ public abstract class AbstractBasicJavaTypedHandler extends TypedHandlerDelegate
|
||||
|
||||
HighlighterIterator iterator = editor.getHighlighter().createIterator(offset);
|
||||
CharSequence sequence = editor.getDocument().getCharsSequence();
|
||||
if (!iterator.atEnd() &&
|
||||
(iterator.getTokenType() == JavaTokenType.STRING_TEMPLATE_END || iterator.getTokenType() == JavaTokenType.TEXT_BLOCK_TEMPLATE_END)) {
|
||||
if (!iterator.atEnd() && iterator.getStart() == offset &&
|
||||
(iterator.getTokenType() == JavaTokenType.STRING_TEMPLATE_END || iterator.getTokenType() == JavaTokenType.TEXT_BLOCK_TEMPLATE_END ||
|
||||
iterator.getTokenType() == JavaTokenType.STRING_TEMPLATE_MID || iterator.getTokenType() == JavaTokenType.TEXT_BLOCK_TEMPLATE_MID)) {
|
||||
if (sequence.length() > offset && sequence.charAt(offset) == '}') {
|
||||
editor.getCaretModel().moveToOffset(offset + 1);
|
||||
return Result.STOP;
|
||||
|
||||
Reference in New Issue
Block a user