2014-05-19 6 views
6

पर जाएं Ice संपादक के साथ एक काफी सरल ऑपरेशन का प्रयास कर रहा हूं: संपादक को किसी विशेष पंक्ति पर कूदना है। मैं इसे काम करने के लिए नहीं मिल सकता, यद्यपि! http://jsfiddle.net/Xu9Tb/ऐस संपादक -

var editor = ace.edit('editor'); 

editor.scrollToLine(50, true, true, function() {}); 
    // Doesn't do anything at all 

editor.gotoLine(50, 10, true); 
    // Will move the caret to the line, but it will not scroll 
    // to the editor to the line if it's off screen 

किसी भी सलाह:

इस jsFiddle देखते हैं?

धन्यवाद।

उत्तर

10

ऐस संपादक के वर्तमान संस्करण में एक बग प्रतीत होता है। आप मैन्युअल रूप से editor.resize(true) कॉल करते हैं, यह ऊंचाई पुनर्गणना जाएगा और स्क्रॉल कार्यों को सही ढंग से काम करते हैं:

var editor = ace.edit('editor'); 
editor.resize(true); 

editor.scrollToLine(50, true, true, function() {}); 

editor.gotoLine(50, 10, true); 

http://jsfiddle.net/Xu9Tb/1/

+0

यह भी दुर्भाग्य से नवीनतम संस्करण में टूट किया जा रहा है (v1.2.6) – pootzko

संबंधित मुद्दे