Expected Behavior
When setting a style of CodeArea the background should span only the required positions.
Actual Behavior
When there is one character between two styles with background then the character without style also gets the background. In the picture the first b and space should be without background.

Reproducible Demo
import java.util.List;
import org.fxmisc.richtext.CodeArea;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class JFXDemo extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
CodeArea codeArea = new CodeArea("aba abba");
codeArea.getStylesheets().add(getClass().getResource("fx.css").toExternalForm());
codeArea.setStyle(0, 1, List.of("mystyle"));
codeArea.setStyle(2, 3, List.of("mystyle"));
codeArea.setStyle(4, 5, List.of("mystyle"));
codeArea.setStyle(7, 8, List.of("mystyle"));
StackPane root = new StackPane();
root.getChildren().add(codeArea);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}
}
.mystyle {
-fx-fill: red;
-rtfx-background-color: #ccc;
}
Environment info:
- RichTextFX Version: 0.8.2
- Operating System: Windows 7
- Java version: 10
Expected Behavior
When setting a style of CodeArea the background should span only the required positions.
Actual Behavior
When there is one character between two styles with background then the character without style also gets the background. In the picture the first b and space should be without background.
Reproducible Demo
Environment info: