Skip to content
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

Ace Marker at wrong position #2130

Closed
BoasE opened this issue Sep 5, 2014 · 4 comments
Closed

Ace Marker at wrong position #2130

BoasE opened this issue Sep 5, 2014 · 4 comments

Comments

@BoasE
Copy link

BoasE commented Sep 5, 2014

Hi

I'm using ace 1.1.5 and got some problems setting markers

i want to highlight some rows. for this i add markers with the following code

var range = new Range(4, 1, 8, 1);
var marker = $scope.editor.getSession().addMarker(range, "ace-related-code-highlight", "line");

my style is :

.ace-related-code-highlight {
     background-color: yellow;
}

But ace highlits the first rows s. ace1.png. i f triger again the exact same code with same range it highlights the next rows s. ace2.png

I found out that he always respects the highgt of the range but starts on top. in de example above he highlights lines 1-5 . second click 5- 10 and so on.
But on scrolling the range moves. some times line 11 is marked and sometimes line 10 is only halfmarked.
so it looks like ace hase some problems with finding the right line ?

Also when sometime when i scroll i get some rendering errors . Only the left part is yellow not the whole line s.ace3.png

any advice of what I am doing wrong?

@nightwing
Copy link
Member

add position:absolute; to .ace-related-code-highlight rule

@BoasE
Copy link
Author

BoasE commented Sep 5, 2014

Thx for help. that improved it

but

when callign

var range = new Range(5, 0, 10, 0);
var marker = $scope.editor.getSession().addMarker(range, "ace-related-code-highlight", "fullLine", false);

it highlights lines 6-11 do i missunderstand the api ?

@nightwing
Copy link
Member

yes, line indexes start at 0.

@BoasE
Copy link
Author

BoasE commented Sep 5, 2014

yeah sure, thx my bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants