光标位置
This commit is contained in:
		
							parent
							
								
									15c03a6a4a
								
							
						
					
					
						commit
						9c70ebc4bf
					
				| 
						 | 
				
			
			@ -172,6 +172,15 @@ var editors = {
 | 
			
		|||
                "Ctrl-D": "doNothing" // 取消默认的 deleteLine
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        editor.on('cursorActivity', function(cm) {
 | 
			
		||||
            var cursor = cm.getCursor();
 | 
			
		||||
 | 
			
		||||
            $("#footer-cursor").text('|   ' + (cursor.line + 1) + ':' + (cursor.ch + 1) + '   |');
 | 
			
		||||
            // TODO: 关闭 tab 的时候要重置
 | 
			
		||||
            // TODO: 保存当前编辑器光标位置,切换 tab 的时候要设置回来
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        editor.setSize('100%', $(".edit-panel").height() - $(".edit-header").height());
 | 
			
		||||
        editor.setValue(data.content);
 | 
			
		||||
        editor.setOption("mode", data.mode);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -141,7 +141,8 @@
 | 
			
		|||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="footer">
 | 
			
		||||
            |
 | 
			
		||||
            <span>|</span>
 | 
			
		||||
            <span id="footer-cursor" style="float: right;"></span>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <script type="text/javascript">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue