editor go to line

330 views
Skip to first unread message

jiun bk

unread,
Jan 8, 2015, 12:56:46 PM1/8/15
to ace-d...@googlegroups.com
Im attempting to use the editor.gotoLine()
and editor.scrollToLine()  but neither are working for me,
gotoLine responds by highlighting the line as well as the cursor being placed there,
but the editor itself does not move, this is bad especially when the line  is not currently visible,

iv tried with these solutions suggested on  SO:
http://stackoverflow.com/questions/23748743/ace-editor-go-to-line

they work on  jsfiddle  (as well as on the  ace.c9.io embedded editors), but i can not  seem to
get it  to work  on my editor instance, im using the ace-builds  src-min-noconflict available right now on
ace-builds.

Jiun

Harutyun Amirjanyan

unread,
Jan 10, 2015, 9:57:38 AM1/10/15
to ace-d...@googlegroups.com
I can help you debug the issue, if you show me a demo page where it fails.

--
You received this message because you are subscribed to the Google Groups "Ajax.org Cloud9 Editor (Ace)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ace-discuss...@googlegroups.com.
To post to this group, send email to ace-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/ace-discuss.
For more options, visit https://groups.google.com/d/optout.

jiun bk

unread,
Jan 10, 2015, 3:13:14 PM1/10/15
to ace-d...@googlegroups.com
Hi,
thanks,  but i think i have figured out a way around  the issue,  it seems the  height  update trick  described here:
http://stackoverflow.com/questions/11584061/automatically-adjust-height-to-contents-in-ace-cloud9-editor
(i updated the height onchange basically )

 was causing the issue, i changed  it to use the alternative method for setting height:  maxLines
that and using  these two,
editor.scrollToRow(line );
editor.scrollToLine(line);

seems to have done the trick,
Jiun.
Reply all
Reply to author
Forward
0 new messages