Issue with AddMarker

966 views
Skip to first unread message

DrKameleon WasHere

unread,
Jun 14, 2015, 5:50:19 AM6/14/15
to ace-d...@googlegroups.com
I'm trying to use "editor.session.addMarker", e.g.:

aceRange = ace.require('ace/range').Range;
session.addMarker(new aceRange(0,1,2,10), "some_custom_class", "line");

but I keep getting a weird error:

Uncaught TypeError: marker.range.clipRows is not a function

What is going on? 

Harutyun Amirjanyan

unread,
Jun 14, 2015, 7:06:09 AM6/14/15
to ace-d...@googlegroups.com
aceRange = require('ace/range').Range;
editor.session.addMarker(new aceRange(0,1,2,10), "some_custom_class", "line");
require("ace/lib/dom").importCssString('.some_custom_class {\
    background-color: aquamarine;\
    position: absolute;\
}')
in the console, creates marker as expected.
May be something is broken by your modifications?

DrKameleon WasHere

unread,
Jun 14, 2015, 7:50:27 AM6/14/15
to ace-d...@googlegroups.com
Hmm... That's exactly what I suspected myself.

The thing is - given our latest message exchange - I decided to make... a leap of faith and update my old, super-tweaked Ace code based, with the freshest Ace build possible (and then re-attach my modifications - none of which is Marker-related).

Now, here's the weirdest thing: I just copy-pasted your code in Kitchen Sink and it worked. And it also work with my local testing page. Could it have been that I was not testing it with an existing CSS class? That's really weird! I must have tried every possible variation of those 1-2 commands...

j...@doselect.com

unread,
Dec 2, 2016, 8:25:06 AM12/2/16
to Ajax.org Cloud9 Editor (Ace)
Hey. I'm stuck with the same issue.

```
angular-v1.5.3.min.js:116 TypeError: r.range.clipRows is not a function
    at t.FontMetrics.r._emit.r._dispatchEvent (http://doselect.local:8000/static/dist/scripts/ace-v1.2.5.min.js:1:49966)
    at Array.forEach (native)
    at XMLHttpRequest.c (http://doselect.local:8000/static/dist/scripts/angular-raven-v2.3.0.min.js:2:3806) <div class="editor ng-pristine ng-untouched ng-valid ace_editor ace-tm" ui-ace="{onLoad:aceLoaded}" ng-model="code" ng-change="autoSave()" ng-show="runner.selectedTab==0" flex="" style="font-size: 15px; height: 300px;">
```

Any idea what exactly is wrong?

P.S: Two code samples. Both work well. How do you zero-in on the better sample? Here's How.

CONFIDENTIALITY INFORMATION AND DISCLAIMER
The contents of this e-mail are intended for the named addressee only. It contains information which may be confidential and which may also be privileged. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system.  If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person, doing so may be unlawful.
Please consider the environment before printing this email.
Reply all
Reply to author
Forward
0 new messages