ace-editor

Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:9000/worker-html.js' failed to load

こ雲淡風輕ζ 提交于 2020-04-18 03:51:11
问题 I am using Ace Editor in my Angular application. It is defined here - https://www.npmjs.com/package/ng2-ace-editor Usage: .html <ace-editor id="editor" class="form-control" formControlName="answer" [ngClass]="validateField('answer')" [(text)]="text"></ace-editor> .ts ngAfterViewInit(){ this.editor = ace.edit('editor'); ace.config.set('basePath', '/assets/ui/'); ace.config.set('modePath', '/assets/ui/'); ace.config.set('themePath', '/assets/ui/'); ace.config.setModuleUrl('ace/mode/php_worker',

Ace Code Editor Set Language Dynamically [closed]

谁说我不能喝 提交于 2020-01-24 04:17:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm attempting to implement Ace Code Editor with a drop down to select the language. My drop down has an id of mode. I have got the editor to work correctly, but I cannot change the language using the drop down as I would like it to do. My current code is var editor = ace.edit("code"); var textarea = $('textarea

Is there a way to hide the line numbers in Ace Editor?

孤人 提交于 2020-01-21 06:25:10
问题 Is there any way to remove the line numbers when using the ace editor? Similar to removing the print margin as shown below? editor.setShowPrintMargin(false); 回答1: Use editor.renderer.setShowGutter(true/false); http://ace.c9.io/#VirtualRenderer.setShowGutter=&nav=api&api=virtual_renderer Editor Options https://github.com/ajaxorg/ace/wiki/Configuring-Ace 回答2: If you want to hide the line numbers but keep the gutter for the folding widgets: editor.renderer.setOption('showLineNumbers', false);

Is there a way to hide the line numbers in Ace Editor?

南笙酒味 提交于 2020-01-21 06:22:14
问题 Is there any way to remove the line numbers when using the ace editor? Similar to removing the print margin as shown below? editor.setShowPrintMargin(false); 回答1: Use editor.renderer.setShowGutter(true/false); http://ace.c9.io/#VirtualRenderer.setShowGutter=&nav=api&api=virtual_renderer Editor Options https://github.com/ajaxorg/ace/wiki/Configuring-Ace 回答2: If you want to hide the line numbers but keep the gutter for the folding widgets: editor.renderer.setOption('showLineNumbers', false);

Embedding Ace Editor inside jQuery UI Resizable Component

核能气质少年 提交于 2020-01-12 08:42:31
问题 I'm trying to make an ace editor resizable by embedding it inside a resizable component. I've been trying to use the jQuery UI Resizable component, but I can't get the ace editor to appear inside the resizable component. Code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Resizable Ace Editor Using jQuery</title> <script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="//code.jquery

Misspelled Ace Editor Options

冷暖自知 提交于 2020-01-12 05:30:09
问题 I have implemented an Ace editor setup for PHP (which is working fine), but when I try to set additional options using Ace's API, I receive warnings in the console. Here is the code used to init the editor and try to set the options; ace.require("ace/ext/language_tools"); ace.require("ace/ext/emmet"); // PHP var phpeditor = ace.edit("php_inc"); phpeditor.setTheme("ace/theme/dreamweaver"); phpeditor.getSession().setMode("ace/mode/php"); phpeditor.setOptions({ enableSnippets: true,

ACE Editor adding Snippet with new line character

可紊 提交于 2020-01-06 17:59:09
问题 I am trying to add snippets for ACE Editor, I was able to achieve that by adding the snippets manually as follows. ace.define("ace/snippets/c_cpp",["require","exports","module"], function(require, exports, module) { "use strict"; # std::vector\n\ snippet vector\n\ std::vector<${1:T}> ${2};${3}\n\ # std::deque\n\ snippet deque\n\ std::deque<${1:T}> ${2};${3}\n\ ... Everything works well until I add a new line in a snippets, it then doesn't work since the editor is using the new line as a token

ACE Editor adding Snippet with new line character

爷,独闯天下 提交于 2020-01-06 17:58:17
问题 I am trying to add snippets for ACE Editor, I was able to achieve that by adding the snippets manually as follows. ace.define("ace/snippets/c_cpp",["require","exports","module"], function(require, exports, module) { "use strict"; # std::vector\n\ snippet vector\n\ std::vector<${1:T}> ${2};${3}\n\ # std::deque\n\ snippet deque\n\ std::deque<${1:T}> ${2};${3}\n\ ... Everything works well until I add a new line in a snippets, it then doesn't work since the editor is using the new line as a token

Empty line in ace editor shows “x” mark in custom mode

旧时模样 提交于 2020-01-05 02:03:13
问题 I already worked on the following ticket How to integrate syntax check in Ace Editor using custom mode? I want to build the custom mode for ace editor (i.e every lines must contains semi colon except empty lines), so I created worker and mode based on above ticket, but now the issue is "missing semicolon" error shown for empty lines consider the example: In the ace editor, type in a query1, query2 in line 1 and line 2 respectively Leave the third line blank Now in fourth line, type a query

How do I use getvalue using Ace Editor?

本秂侑毒 提交于 2020-01-01 16:07:29
问题 I am using the Ace Editor, but I do no use JavaScript a lot so I'm finding it hard to make it actually work without a proper documentation. I'm working on a local PHP file editor.. so open files etc, works fine, setcontent works like a charm. But now I want to save the editor's information back to the file. In itself not really a problem. But how do I retrieve the var code. If I use document.write it will not show the current information in the editor If I could print out what is in the