Gutter components should be notified when the Document is updated. Currently they're only notified when a DocumentEvent occurs, but when loading entirely new content via JTextComponent#read(), we create a new RDocument instance and swap it out with the old one for performance reasons.
This PR notifies all Gutter components when a new Document is set on the text area. Currently only LineNumberList does anything - it recalculates its preferred width.
Note: This isn't always reproducible, e.g. it isn't reproducible in RText. It is reproducible in the RSTA demo app if you add > 100 lines to one of the sample language source files, then flip back and forth between it. This triggers a TextEditorPane.load(), which ultimately delegates to JTextComponent.read().
Gutter components should be notified when the
Document
is updated. Currently they're only notified when aDocumentEvent
occurs, but when loading entirely new content viaJTextComponent#read()
, we create a newRDocument
instance and swap it out with the old one for performance reasons.This PR notifies all Gutter components when a new
Document
is set on the text area. Currently onlyLineNumberList
does anything - it recalculates its preferred width.Note: This isn't always reproducible, e.g. it isn't reproducible in RText. It is reproducible in the RSTA demo app if you add > 100 lines to one of the sample language source files, then flip back and forth between it. This triggers a
TextEditorPane.load()
, which ultimately delegates toJTextComponent.read()
.