(四)CodeMirror - API

时间:2014-11-22 21:32:42   收藏:0   阅读:214

内容相关

cm.getValue()

cm.setValue()

cm.getRange()

editor.getRange({line:1},{line:2})  // 获取内容块字符

cm.replaceRange()

// 替换内容块内容为test
editors[‘js‘].replaceRange(‘test‘,{line:2,ch:0},{line:2})    
var lineobject = editors.getLineHandle(1)    // 获取行对象

Structure
{
    gutterMarkers: Object
    height: 14
    parent: LeafChunk
    stateAfter: Object
    styles: Array[11]
    text: "init:function() {"  
}

cm.scrollTo()

editors.scrollTo(0,1000)    // 滚动到x:0,y:1000

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!