Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Commit c5aacf3

Browse files
committed
Fix bobbylight#189: IllegalArgumentException when uninstalling RTextAreaUI
1 parent b6fddd4 commit c5aacf3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextArea.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,6 +2566,14 @@ public void setFractionalFontMetricsEnabled(boolean enabled) {
25662566
*/
25672567
@Override
25682568
public void setHighlighter(Highlighter h) {
2569+
2570+
// Ugh, many RSTA methods assume a non-null highlighter. This is kind
2571+
// of icky, but most applications never *don't* want a highlighter.
2572+
// See #189 - BasicTextUI clears highlighter by setting it to null there
2573+
if (h == null) {
2574+
h = new RSyntaxTextAreaHighlighter();
2575+
}
2576+
25692577
if (!(h instanceof RSyntaxTextAreaHighlighter)) {
25702578
throw new IllegalArgumentException("RSyntaxTextArea requires " +
25712579
"an RSyntaxTextAreaHighlighter for its Highlighter");

0 commit comments

Comments
 (0)