mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	add 2 ace compatible functions
- clearSelection - blocky node - selectAll - obvious addition
This commit is contained in:
		@@ -31,6 +31,8 @@
 | 
			
		||||
        function setMode(mode, cb)
 | 
			
		||||
        function getRange();
 | 
			
		||||
        function replace(range, text)
 | 
			
		||||
        function selectAll 
 | 
			
		||||
        function clearSelection
 | 
			
		||||
        function getSelectedText()
 | 
			
		||||
        function destroy()
 | 
			
		||||
        function resize()
 | 
			
		||||
@@ -1013,11 +1015,20 @@ RED.editor.codeEditor.monaco = (function() {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ed.selectAll =  function selectAll() {
 | 
			
		||||
            const range = ed.getModel().getFullModelRange();
 | 
			
		||||
            ed.setSelection(range);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ed.clearSelection = function clearSelection() {
 | 
			
		||||
            ed.setPosition({column:1,lineNumber:1});
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ed.getSelectedText = function getSelectedText() {
 | 
			
		||||
            return ed.getModel().getValueInRange(ed.getSelection());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ed.insertSnippet = function editer_insertSnippet(s) {
 | 
			
		||||
        ed.insertSnippet = function insertSnippet(s) {
 | 
			
		||||
            //https://github.com/microsoft/monaco-editor/issues/1112#issuecomment-429580604
 | 
			
		||||
            //no great way of triggering snippets!
 | 
			
		||||
            let contribution = ed.getContribution("snippetController2");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user