File tree Expand file tree Collapse file tree
richtextfx/src/main/java/org/fxmisc/richtext Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import java .util .function .IntFunction ;
44
55import javafx .geometry .Insets ;
6+ import javafx .geometry .Pos ;
67import javafx .scene .Node ;
78import javafx .scene .control .Label ;
89import javafx .scene .layout .Background ;
@@ -29,7 +30,7 @@ public class LineNumberFactory implements IntFunction<Node> {
2930 new Background (new BackgroundFill (Color .web ("#ddd" ), null , null ));
3031
3132 public static IntFunction <Node > get (GenericStyledArea <?, ?, ?> area ) {
32- return get (area , digits -> "%0 " + digits + "d " );
33+ return get (area , digits -> "%1$ " + digits + "s " );
3334 }
3435
3536 public static IntFunction <Node > get (
@@ -57,6 +58,7 @@ public Node apply(int idx) {
5758 lineNo .setBackground (DEFAULT_BACKGROUND );
5859 lineNo .setTextFill (DEFAULT_TEXT_FILL );
5960 lineNo .setPadding (DEFAULT_INSETS );
61+ lineNo .setAlignment (Pos .TOP_RIGHT );
6062 lineNo .getStyleClass ().add ("lineno" );
6163
6264 // bind label's text to a Val that stops observing area's paragraphs
You can’t perform that action at this time.
0 commit comments