JS editor breaks on backslash

I have string like this (there are several strings concatenated):
return '<div id="typeSelector">' +

If I remove "' +" from the end of line and enter backslash "\" at the end of line in JavaScript editor, bad things happen:

No message java.lang.AssertionError at com.intellij.openapi.editor.ex.util.SegmentArray.findSegmentIndex(SegmentArray.java:18) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.(LexerEditorHighlighter.java:4) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.createIterator(LexerEditorHighlighter.java:37) at com.intellij.codeInsight.highlighting.BraceHighlightingHandler.updateBraces(BraceHighlightingHandler.java:119) at com.intellij.codeInsight.highlighting.BraceHighlighter$2.run(BraceHighlighter.java:0) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:16) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:149) at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:136) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:12) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) java.lang.AssertionError at com.intellij.openapi.editor.ex.util.SegmentArray.findSegmentIndex(SegmentArray.java:18) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.(LexerEditorHighlighter.java:4) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.createIterator(LexerEditorHighlighter.java:37) at com.intellij.openapi.editor.impl.IterationState.(IterationState.java:57) at com.intellij.openapi.editor.impl.EditorImpl.a(EditorImpl.java:1153) at com.intellij.openapi.editor.impl.EditorImpl.logicalPositionToXY(EditorImpl.java:321) at com.intellij.openapi.editor.impl.EditorImpl.a(EditorImpl.java:248) at com.intellij.openapi.editor.impl.EditorImpl.b(EditorImpl.java:1424) at com.intellij.openapi.editor.impl.EditorImpl.paint(EditorImpl.java:1233) at com.intellij.openapi.editor.impl.EditorComponentImpl.paintComponent(EditorComponentImpl.java:51) at javax.swing.JComponent.paint(JComponent.java:1002) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5084) at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:279) at javax.swing.RepaintManager.paint(RepaintManager.java:1106) at javax.swing.JComponent._paintImmediately(JComponent.java:5032) at javax.swing.JComponent.paintImmediately(JComponent.java:4842) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:670) at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:650) at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:149) at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:136) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:12) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) java.lang.AssertionError at com.intellij.openapi.editor.ex.util.SegmentArray.findSegmentIndex(SegmentArray.java:18) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.(LexerEditorHighlighter.java:4) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.createIterator(LexerEditorHighlighter.java:37) at com.intellij.openapi.editor.impl.IterationState.(IterationState.java:57) at com.intellij.openapi.editor.impl.EditorImpl.a(EditorImpl.java:1153) at com.intellij.openapi.editor.impl.EditorImpl.visualPositionToXY(EditorImpl.java:1193) at com.intellij.openapi.editor.impl.EditorImpl.getPreferredSize(EditorImpl.java:1359) at com.intellij.openapi.editor.impl.EditorImpl.validateSize(EditorImpl.java:615) at com.intellij.openapi.editor.impl.ScrollingModelImpl.scrollToCaret(ScrollingModelImpl.java:49) at com.intellij.openapi.editor.impl.CaretModelImpl.moveCaretRelatively(CaretModelImpl.java:77) at com.intellij.openapi.editor.actions.MoveCaretDownAction$Handler.execute(MoveCaretDownAction.java:2) at com.intellij.codeInsight.lookup.impl.DownHandler.execute(DownHandler.java:0) at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:52) at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:80) at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:72) at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:58) at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:43) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:76) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:79) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:44) at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:2) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:12) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) java.lang.AssertionError at com.intellij.openapi.editor.ex.util.SegmentArray.findSegmentIndex(SegmentArray.java:18) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter$HighlighterIteratorImpl.(LexerEditorHighlighter.java:4) at com.intellij.openapi.editor.ex.util.LexerEditorHighlighter.createIterator(LexerEditorHighlighter.java:37) at com.intellij.openapi.editor.impl.IterationState.(IterationState.java:57) at com.intellij.openapi.editor.impl.EditorImpl.a(EditorImpl.java:1153) at com.intellij.openapi.editor.impl.EditorImpl.visualPositionToXY(EditorImpl.java:1193) at com.intellij.openapi.editor.impl.EditorImpl$17.run(EditorImpl.java:3) at com.intellij.openapi.editor.impl.EditorImpl.paint(EditorImpl.java:108) at com.intellij.openapi.editor.impl.EditorComponentImpl.paintComponent(EditorComponentImpl.java:51) at javax.swing.JComponent.paint(JComponent.java:1002) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5084) at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:279) at javax.swing.RepaintManager.paint(RepaintManager.java:1106) at javax.swing.JComponent._paintImmediately(JComponent.java:5032) at javax.swing.JComponent.paintImmediately(JComponent.java:4842) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:670) at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:650) at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:149) at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:136) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:12) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

]]>

To restore normal editing, I've to disable "inspections" highlighting level to "none" and restore "' +" symbols.

Message was edited by:
Alexander Babaev

2 comments
Comment actions Permalink

Hello Alexander,

AB> I have string like this (there are several strings concatenated):
AB>
AB> return '' + AB> .. AB> If I remove "' +" from the end of line and enter backslash "\" at AB>]]> the end of line in JavaScript editor, bad things happen:

Please file a JIRA issue for this.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.