Is there a way to have a gap between the line separating line numbers and the code?

167 views Asked by At

As the title says - I am trying to figure out a way to make a small gap, say 5 pixels, between the line separating line numbers and the source code in a RSyntaxTextArea instance of my editor. I was looking at the API and found nothing...

NOTE: I am using the latest version available on Maven central - v2.5.3.

Here is a simple demo where you can see how close the gap is: enter image description here

1

There are 1 answers

0
DejanLekic On

I was too quick to ask the question... RTextAreaBase provides the getMargin() and setMargin() methods that can be used to change the insets of the component.

The following simple line increases the gap:

// Increase the gap between the (vertical) margin line and the source code.
Insets in = textArea.getMargin();
textArea.setMargin(new Insets(in.top, in.left + 5, in.bottom, in.right));