ace-editor

How to set focus on the ace editor?

爱⌒轻易说出口 提交于 2019-12-20 10:30:44
问题 I am using the ace editor component from ajax.org inside a jquery tab interface. Each tab will contain a separate ace editor. Whenever I switch to a new tab, the editor in it won't get the focus. I can detect when a tab is selected by binding to the "tabsshow" event of jquery UI. Does any one know how to set focus to the editor in it if say the id of my editor div is editor-tab-0 for the first tab, and so on...? Please can some one help? 回答1: editor.focus(); //To focus the ace editor var n =

ACE Editor Autocomplete - custom strings

笑着哭i 提交于 2019-12-18 12:22:30
问题 I'm using ACE Editor within a Chrome extension. I'm using ACE's Autocomplete feature but I want to be able to completely define a list of static strings to use for the autocomplete, instead of any local strings or snippets. (In the future I might be using something more sophisticated than a static list, but for now static is fine.) Can anyone provide some instruction on how to accomplish this? I already have autocomplete enabled and snippets off, but I'm having trouble defining a static list

How do I get value from ACE editor?

爱⌒轻易说出口 提交于 2019-12-18 10:22:31
问题 I am using ACE editor for the first time. I have the below questions related to it. How do I find the instance of ACE editor on the page? I don't want to maintain a global variable which will hold the editor instance. I need to find its instance on demand. How to get and set its value? I am open for suggestions for any better editor than ACE editor which will support almost all types of language/markup/css etc and highly integrated with jQuery . 回答1: Per their API: Markup: <div id="aceEditor"

How to format XML code in Ace Editor?

柔情痞子 提交于 2019-12-14 01:32:08
问题 I am using ACE Editor to display xml content on my web page. I want to format the xml code in Editor. Can Any one tell me how to do this ? 回答1: There are numerous modes included in the package and the Wiki at github will tell you how to implement it. Something like this: var Mode = require('ace/mode/xml').Mode; editor.getSession().setMode(new Mode()); 回答2: XML Code formatting is not specified in Ace itself, as it's just an editor. Use any of the answers in this question to prettify the code.

ACE editor autocompletion keywords in upper case

老子叫甜甜 提交于 2019-12-13 18:40:51
问题 I have an ACE editor with a custom highlight mode, based on sql mode, and all is working fine, but I am defining keywords in upper case, and when autocompleter shows the available options, all of them are in lower case. I have checked the old sql mode (before my modifications) and the behaviour is exactly the same. Is there any way of converting this options to upper case? I have review this question, but I have been unable to find a way to do it. I have also tried to remove all toLowerCase()

Ace Editor Pause/Disable UndoManager

谁都会走 提交于 2019-12-13 03:34:24
问题 Is there any way to remove specific stack value from UndoManager OR any function to pause/disable and start/enable UndoManager again. I want not to push specific data to UndoManager's stack . 回答1: It is not possible to simply not push deltas to the stack, since in that case undoing previous deltas won't be possible, you need to also transform the deltas around skipped delta. Say if you have a document "xyz" to which {insert, 2, "a"} is applied to obtain "xyaz" and then {insert, 1, "b"} to get

Icefaces ace:dataTable lazy loading

…衆ロ難τιáo~ 提交于 2019-12-12 14:15:50
问题 Is there anybody who have a little example of a lazy loading with ace:dataTable?.. I can't understand how to implement the load method of the class LazyDataModel.. and how to fetch data from a Database through this method.. thanks! 回答1: ace:dataTable has already a "built in" lazy loading mechanism in ICEFaces (at least for release 3.x and up). No need to extend an AbstractList for this anymore. All you need to do is add the lazy="true" to your tag, and make sure the " value " attribute points

Host mode files separately from Ace Editor

老子叫甜甜 提交于 2019-12-12 10:56:23
问题 I want to bundle ACE Editor with the desktop application and render it inside WebView. Ace is running from file:/// protocol. Is there any way to host Mode files separately from ace.js ? For example ace.js will be located inside the application bundle /Application/MyApp.app/... , but mode files at ~/Library/Application Support/MyApp/ace/modes . I started with test project and have the following code <script type="text/javascript"> var require = { baseUrl: window.location.protocol + "//" +

Does the ace core classes keep track of all of the editor instances on a page?

落爺英雄遲暮 提交于 2019-12-12 04:34:12
问题 I'm planning on having multiple ace editor instances on a page and I'd like to know if the core libraries are keeping track of them so I can easily get a reference to them later. If not, would keeping the editor instances in a dictionary or object be a good way to do it? Could I create an object on the ace class and should they be by reference or id? var editor1 = ace.edit("myEditorDivID"); var editor2 = ace.edit("myEditorDivID2"); var editors = ace.editors; console(editor1==editors[

Detect a right-click on Ace editor

假装没事ソ 提交于 2019-12-12 03:58:38
问题 Is there a way to detect a right-click event on Ace editor? I've being trying to add a listener like this: editor.session.addEventListener('contextmenu', function(e) { e.preventDefault(); alert('success!'); return false; }, false); and this editor.addEventListener('contextmenu', function(e) { e.preventDefault(); alert('success!'); return false; }, false); but without success. Thanks! 回答1: add event listener on the element containing the editor editor.container.addEventListener("contextmenu",