ace-editor

Altering RStudio Editor Theme

依然范特西╮ 提交于 2019-12-05 11:38:24
I am trying to alter an RStudio Editor Themes so that I can set my own colors. I'm using RStudio version 0.99.473 on Windows 10. I've reviewed Any way to change colors in Rstudio to something other than default options? which was extremely helpful as well as Editing R Studio them in cashe.css theme file (ACE editor?) I am trying to identify what the different .ace_ items in the RStudio Editor Theme CSS files (ACE editor code) correspond to. The CSS files are found in /www/rstudio/ within RStudio's install path. An example of the script is found on GitHub for the Tomorrow theme . In particular,

Recursive blocks in Ace editor

爷,独闯天下 提交于 2019-12-05 05:02:12
We've got our own scripting language that we use. The language is quite simple, but it has one 'exclusive' thing: strings are defined using '[' and ']' (so "test" would be [test]), and these braces can be inside each other: lateinit([concat([test], [blah])]) Also, there's no escaping character. How does one parse this block as one string (thus highlighting the [concat([test], [blah])] block)? I currently got the following rule: { token: 'punctuation.definition.string.begin.vcl', regex: '\\[', push: [ { token: 'punctuation.definition.string.end.vcl', regex: '\\]', next: 'pop' }, { defaultToken:

ace editor cursor behaves incorrectly

别说谁变了你拦得住时间么 提交于 2019-12-04 22:35:33
I am using Ace editor in my project. CSS: #editor { position:absolute; top:0; left:0; width:100%; height:100%; background-color:white; } JavaScript: var editor = ace.edit("editor"); editor.setTheme("ace/theme/textmate"); editor.getSession().setMode("ace/mode/java"); #editor is contained in a relatively positioned div. The problem is hard to explain but I'll try. Whenever I type text in Ace as the line size increases the spaces in the cursor's actual position and it's expected position increases. For example when I type "This is text" it shows like this: This is text | Now when I press

How do I use ACE with my ASP.NET MVC application?

走远了吗. 提交于 2019-12-04 17:48:01
问题 I want to use the ACE online code editor in my project. How do I use it in ASP.NET MVC? I'd like to save whatever edits are made with that editor in the database. How do I do that? 回答1: Let's assume you have a strong typed model with a property called Editor with the data in it. Now use a normal <div> to load the data: <div id="editor"><%=Model.Editor %></div> Now you can create an ace editor in place of the div with javascript: <script src="src/ace.js" type="text/javascript" charset="utf-8">

Using a canvas element as a textarea

大城市里の小女人 提交于 2019-12-04 17:42:10
I'm looking for a straight forward description of how to use a canvas element sort of like a text area. I have seen projects such as Ace . Just wondering how to go about writing to the area as if it where a textarea. Just plain text, nothing fancy. Thanks in advance. Ace used to be Mozilla Skywriter, which used to be Mozilla Bespin. The code for Bespin is actually pretty simple to understand if you are willing to dig through it and make your own based on it, but it is sort of a fool's errand. The Canvas spec actually advises specifically against this: Authors should avoid implementing text

Set Value for ace editor without selecting the whole editor

☆樱花仙子☆ 提交于 2019-12-04 14:56:12
问题 So you can set value of an ace editor with setValue but after setting the value, the editor will select the whole value of the editor. How do you disable this? This mean when I set value of ace editor to Hello world , it won't highlight Hello world 回答1: You can use the second parameter to control cursor position after setValue editor.setValue(str, -1) // moves cursor to the start editor.setValue(str, 1) // moves cursor to the end 回答2: You can even use clearSelection() after you do an setValue

Javascript intellisense in ACE editor

爱⌒轻易说出口 提交于 2019-12-04 13:05:15
问题 TL;DR I need intelligent autocompletion/intellisense for JavaScript in ACE Editor. Explanation I am creating an online IDE for JavaScript using ACE Editor. Is there any library or open-source project that allows intelligent autocompletion for JavaScript. JavaScript is a dynamic language, intellisense integration is trivial for such languages (TypeScript does support this). ACE editor only supports basic autocompletition (like Sublime Text) using enableBasicAutocompletion . I need intelligent

How do I use getvalue using Ace Editor?

血红的双手。 提交于 2019-12-04 12:42:06
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 editor I could save the data. But I don't know how to provide a valid callback for getValue Can someone

applyDeltas in ACE editor

霸气de小男生 提交于 2019-12-04 12:04:10
I'm trying to save change actions in an Ace editor and then play them back. There's some pseudo-ish code below - the gist is that the applyDeltas API doesn't seem to do anything for my editor. I bind to the editor change event, push change deltas to an array, and try to play it back later - I don't see any errors when I run the code below, but I also don't see my editor content change. Thanks Mustafa shouldRecord = true; myStoredArray = new Array(); editor.on('change', function(e) { if(shouldRecord) { myStoredArray.push(e.data); } }); //on a button click shouldRecord = false; editor.getSession

Retrieve line number of string in Ace Editor

心已入冬 提交于 2019-12-04 09:19:54
I'm trying to retrieve the line number of a given string in the text displayed in the ace editor. Example: searching for "foo" Return: [ 4, 5 ] Condition: Line 4 and 5 in the content of the ace editor contains the "foo" string Iterate over all lines and check indexOf function findFooLineNumbers(editor, foo) { var lines = editor.session.doc.getAllLines() var fooLineNumbers = [] for (var i = 0, l = lines.length; i < l; i++) { if (lines[i].indexOf(foo) != -1) fooLineNumbers.push(i) } return fooLineNumbers } You left too little information and you can not expect a great help If you want to return