Add padding top/bottom in editor

3,521 views
Skip to first unread message

DrKameleon WasHere

unread,
Jun 18, 2015, 7:30:23 AM6/18/15
to ace-d...@googlegroups.com
OK, let me explain what I'm trying to do:

Let'a say we have a number of visible lines within the editor. I want to add some padding ON TOP of the very first visible line. And some padding BELOW the very last one.

Is that possible?

I tried adding some padding via CSS to the _content and _gutter-layer sections, but it seems to cause issues with the bottom part of the content (which gets hidden):

.ace_gutter-layer {
padding-top:1px;
}
.ace_content {
padding-top:1px;
}

Harutyun Amirjanyan

unread,
Jun 18, 2015, 7:47:57 AM6/18/15
to ace-d...@googlegroups.com
try editor.renderer.setScrollMargin(10, 10)

DrKameleon WasHere

unread,
Jun 18, 2015, 8:11:44 AM6/18/15
to ace-d...@googlegroups.com
Well, it's not exactly what I was looking for...

This *does* add some padding on top of line 1 and below the last line. However when I scroll down the padding goes away (it's just above the first line, not above the first *visible* line)

Τη Πέμπτη, 18 Ιουνίου 2015 - 1:47:57 μ.μ. UTC+2, ο χρήστης Harutyun Amirjanyan έγραψε:
try editor.renderer.setScrollMargin(10, 10)

Harutyun Amirjanyan

unread,
Jun 20, 2015, 4:30:56 PM6/20/15
to ace-d...@googlegroups.com
Ok, i see.
But unfortunately there is no easy way to push text down and keep gutter background and scrollbar stretched to the top of the editor container.
Closest thing will be adding margin to the editor container
Reply all
Reply to author
Forward
0 new messages