-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setOption( "firstLineNumber", 0 ) only works correctly on scrollable and scrolled content #3265
Comments
I can't reproduce this issue, when i run |
I downloaded the build from https://github.com/ajaxorg/ace-builds/ about 3 days ago. Used the "editor.html" in the build as a template (just realised that it uses a <pre> instead of a <div> like the "...and use the code below" example at https://ace.c9.io/#nav=embedding which might make a difference?). Am using the "src-min-noconflict", and to save explaining everything else, it's being served at http://fredgandts.website/lsl/editor/ You should see that until the code is scrolled, the zero is not shown. Being JS, I should also have mentioned using Chrome (Version 57.0.2987.133) on Win7 Home Premium (SP1) I am quite prepared to be told I'm doing it wrong, I just can't see how right now. |
The link was very helpful, thanks! |
I found Reading minified code is slightly less fun than one might think ;-) |
Setting the firstLineNumber to zero fails unless the code displayed is scrollable and has been scrolled.
Setting
editor.setOptions( { "firstLineNumber": 0, "scrollPastEnd": true } );
will trick the first line number to show as zero on shorter content, but still only after the content has been scrolled enough to push the first line out of view.On shorter content, without scrollPastEnd set, the first line number will always be empty.
Adding a hack to set the HTML textContent to zero on initializing ace, causes the first visible line number to always show as zero, even if, whilst scrolling, it should be something else.
FYI: Linden Scripting Language (LSL)'s line numbering starts at zero.
BTW: ace.js is great.
The text was updated successfully, but these errors were encountered: