Miazite
Miazite

Reputation: 43

How can I change the displayed tab width in JavaFX with RichTextFX?

I'm writing a text editor in JavaFX with the RichTextFX library and when I write a tab it has a width of 8. How can I change this without replacing the tab with e.g. 4 whitespaces?

This is what I have at the moment:

Nodes.addInputMap(this.codeArea, InputMap.consume(EventPattern.keyPressed(KeyCode.TAB), e -> {
    this.codeArea.replaceSelection("    ");
}));

It replaces a tab with 4 whitespaces but how can I make that one tab is displayed with a width of 4 whitespaces?

Thank you for answering!

Upvotes: 0

Views: 271

Answers (1)

Related Questions