Giter Club home page Giter Club logo

ace's People

Contributors

43081j avatar adamjimenez avatar akoreman avatar aldendaniels avatar andrewnester avatar buildersbrewery avatar c9developer avatar danyapostfactum avatar dfelder avatar fjakobs avatar gjtorikian avatar gozala avatar h3rb avatar inspiredguy avatar jcheng5 avatar joewalker avatar jviereck avatar lennartcl avatar matthewkastor avatar mattpardee avatar mihaisucan avatar mikedeboer avatar mkslanc avatar mostafaeweda avatar nightwing avatar rksm avatar sevin777 avatar skacurt avatar wcandillon avatar zefhemel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ace's Issues

Editor behaves oddly when initialised with an empty document.

This problem only occurs when the initial document opened is the empty string. The first line of text typed in is invisible, it only appears when the return key is pressed to go to the second line. The line number in the gutter does not show initially either. This happens from commit 8d87f4a, possibly earlier.

Vim like key bindings

I know Julian was working on this, but I thought it would be nice to have a ticket for this to be able to track the state.

Cursor costumization

In order to implement proper vim mode, one will need to be able to change cursor's behavior depending on a mode (normal / insert / visual). In all the modes except insert in vim you have a block cursor that is placed behind the letter instead of being on the right side to it.

Editor is broken on safari

Editor does not loads in safari since latest version does not yet implements .classList property

cliView.js:272TypeError: Result of expression 'this.completer.classList' [undefined] is not an object. 

Probably IE does not has it either, so probably it's broken there as well

setAnnotations triggers error when used with ext

Example:
http://shiftedit.net/tests/ace-annotations

This can be fixed by using hasOwnProperty:

this.setAnnotations = function(annotations) {
    // iterate over sparse array
    this.$annotations = [];
    for (var row in annotations) {
        if (annotations.hasOwnProperty(row) ){
            var rowInfo = this.$annotations[row] = {
                text: []
            };
            var rowAnnotations = annotations[row];
            for (var i=0; i<rowAnnotations.length; i++) {
                var annotation = rowAnnotations[i];

                rowInfo.text.push(annotation.text.replace(/"/g, "&quot;").replace(/'/g, "&rsquo;").replace(/</, "&lt;"));
                var type = annotation.type;
                if (type == "error")
                    rowInfo.className = "ace_error";
                else if (type == "warning" && rowInfo.className != "ace_error")
                    rowInfo.className = "ace_warning";
                else if (type == "info" && (!rowInfo.className))
                    rowInfo.className = "ace_info";
            }
        }
    }
};

PS -- I will figure out how to submit patches properly :)

Wrong key binding for windows

The key stroke for moving one word to the left for example on windows is Ctrl-Left. In the editor, the cursor jumps to the start of the line. Same is true for select left, right and select right.

Documentation (I really hope I'm missing something)

I've been trying to figure out how to use ACE. My first instinct was to read the README, alas — no usage was there. So I opened up the docs folder and got a generated XML document back. Then I tried to check out ace.ajax.org and there seemed to be no help there at all. So I tried searching for textarea in the source of the demo page, but couldn't find anything.

How do you use ACE? What are the config options? What javascript files do I include?

I'm kind of feeling retarded asking these questions and really hope that I'm an idiot and missed something terribly obvious.

Wordwrap fix

With wordwrap turned on an error is thrown on startup:

The fix is simple (ace\lib\ace\edit_session.js):
this.getRowHeight = function(config, row) {
var rows;
- if (!this.$useWrapMode) {
+ if (!this.$useWrapMode || !this.$wrapData[row]) {
rows = 1;
} else {
rows = this.$wrapData[row].length + 1;
}

     return rows * config.lineHeight;
}

Handy method to autowrap text in embedded editors

I have created a simple method to attomatically wrap text to the size of the visible area on resize. It is very handy for embedded editors like Acebug. Maybe you may want to include in the editor? I guess I could have used xpath but I am lazy and the document is always almost empty ;o)

editor.session.setUseWrapMode(true);

editorWin.addEventListener("resize", function() {
    var editor = env.editor;
    var session = editor.session;

    if(session.getUseWrapMode()) {
        var characterWidth = editor.renderer.layerConfig.characterWidth;
        var contentWidth = editor.container.ownerDocument.getElementsByClassName("ace_scroller")[0].clientWidth;

        session.setWrapLimit(parseInt(contentWidth / characterWidth, 10));
    }
}, true);

IOS compatibility

Ace could be a ideal editor on IOS devices (iPad, iPhone) if you just could type, but unfortunately virtual keyboard never shows up with ACE, also I believe someone had a patch for bespin to make that work.
@Gissues:{"order":96.27329192546586,"status":"backlog"}

Editing a RegExpr in JS

If i try to write/delete something at the end of this line, the editor get´s "confused"

{{{ var const2 = /\b(?:A(?:B(?:DAY(?:1|2|3|4|5|6|7)|MON(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION(?:ABORTED|NORMAL|TIMEOUT)|UNT(?:NORMAL|RECURSIVE))|R(?:EDITS(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|(?:FMT|T_FMT))|E(?:NT(?:COMPAT|NOQUOTES|QUOTES)|RA(?:(?:D(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR(?:IF_EXISTS|OVERWRITE|PREFIX(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML(?:ENTITIES|SPECIALCHARS)|IN(?:FO(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I(?:ALL|PERDIR|SYSTEM|USER)|T(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK(?:EX|NB|SH|UN)|G(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|(?:1_PI|2(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO(?:BASENAME|DIRNAME|EXTENSION)|SEPARATOR)|M_STR|OSITIVE_SIGN|(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK(?:CUR|END|SET)|ORT(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/
}}}

Print margin trigers overflow

I used the editor in our qooxdoo playground and saw that scrolling is in some cases, if the code lines are not long, scrolling is still possible. I found out that it is due to the print margin which triggers the overflow. Disabling the margin with setShowPrintMargin did not solve the problem. Setting the print margin column to a very low number and hide is a workaround which worked for me well.

(by wittemann)
@Gissues:{"order":0.6211180124226415,"status":"backlog"}

Three finger gestures don't work

On FF on OSX three finger gesture up / down are shortcut for Home / End. Unfortunately gestures are ignored by ace, would've be nice if it was behaving as expected.
@Gissues:{"order":93.78881987577643,"status":"backlog"}

split views

One of the most useful features of vim are split views. I would really love to have build-in support for them in ace.
@Gissues:{"order":97.51552795031057,"status":"backlog"}

highlight all instances of a selected word

If you double-click a word to select it, highlight all occurrences of that word with some theme-appropriate color. This makes it easy to spot uses of a variable or function.

Editor demo not working in IE8

I checked out the current editor and it seems to fail the loading in IE8 on vista. The errors is in the included require.js file which seems to rely on getAttribute (line 925).

(by wittemann)

Wrap mode error on Document.insertLines/removeLines

Given this case:

var editor = ace.edit("editor");
var session = editor.getSession();
var document = session.getDocument();

session.setUseWrapMode(true);

document.insertLines(0, ["a", "b"]);
document.insertLines(2, ["c", "d"]);
document.removeLines(1, 2);

It works as expected when wrap mode is off, but crashes otherwise:

Uncaught TypeError: Cannot call method 'trimRight' of undefined
$computeWrapSplits src/ace-uncompressed.js:7203
$updateWrapData src/ace-uncompressed.js:7191
$updateWrapDataOnChange src/ace-uncompressed.js:7177
onChange src/ace-uncompressed.js:6569
bound src/ace-uncompressed.js:180
EventEmitter._emit.EventEmitter._dispatchEvent src/ace-uncompressed.js:2330
insertLines src/ace-uncompressed.js:8748

Removing these lines from EditSession.$updateWrapMode seems to fix the bug:

if (action.indexOf("Lines") != -1) {
    if (action == "insertLines") {
        lastRow = firstRow + e.data.lines.length;
    } else {
        firstRow = lastRow - e.data.lines.length;
    }
}

move word should ignore white spaces

Moving the cursor with "move word" behaves different than the native implementation. Usually, moving a word left ignores the space infront of it and jumps to the beginning of the word. The editor jumps first to the end of the word and then to the beginning. This is true for mac and windows.

Missing semicolon in ace\build\src\theme-eclipse.js (compressed) throws JS error

In file ace\build\src\theme-eclipse.js

b.cssClass="ace-eclipse"})define("text!ace/theme/eclipse.css"

should be:
b.cssClass="ace-eclipse"});define("text!ace/theme/eclipse.css"

or it obviously throws an error.

This file is generated by ace\Makefile.dryice.js and that is definitely not my territory or I would fix it there :o/

Holding down Enter key on IE produces strings of "undefined" in text

If you hold down the "Enter" key while using the editor in Internet Explorer, the editor gets into a bad state where it starts inserting strings of

undefinedundefined

into your text. This does not happen in Firefox/Chrome. This appears to occur for two reasons:

  • Differences in key-event delivery. In IE, holding down the Enter key causes multiple newlines to be inserted at once, whereas in Firefox/Chrome, they are always delivered individually. As a result, the text being inserted is "\r\n\r\n" rather than simply "\r\n", and therefore the first case of the $insert function in document.js, "if (this.$isNewLine(text))", is false for IE (because isNewLine only looks for a single newline). So we end up in the third case (multi-line insertion), which should be handled correctly, but...
  • Differences in String.split(). In IE, the string "\r\n\r\n".split(/\r\n|\r|\n/) returns a zero-length array, whereas in Firefox, it returns an array of length two (each of which is a zero-length string). The result of this split() is supposed to be the lines to be inserted in the multiline case, which assumes that the array size is greater than 0 (newLines[newLines.length - 1]). From web searches it appears that using regular expressions in the String.split() method is a potential cross-brower bug factory.

Text goes out of align with line numbers when editor scrolls when taking a new line

Lines of text have their vertical positioning set incorrectly when pressing enter at the end of a document causes the editor window to scroll. See the screenshot here: http://i.imgur.com/4Ld3V.png . The numbers in the document correspond the to line they are on and are out of alignment with the line numbers.

To reproduce, open the latest editor demo and begin to press enter at the bottom of the file. As soon as enough new lines are taken to cause the editor window to scroll, the lines will start to go out of sync. I have tested this in Chrome 8.0.552.237 and Safari 5.0.3. The bug does not seem to appear in Firefox.

I think this may be an issue or subtlety with the rendering engine of WebKit. Using the DOM Inspector shows the div.ace_content element to be shifted to the wrong place (also visible in the screenshot). If I manually remove the 'position: absolute' property from div.ace_scroller and then add it back in then div.ace_content is updated to the correct position. This seems to suggest that Ace is setting up the correct CSS properties, but something is going wrong in the rendering of them. I'm afraid at this point I don't know how to proceed with investigating the problem.

Please let me know if I can provide any more information or if you have any suggestions on how to track down the root cause of this bug. I stumbled across the editor a while ago, but only tried it out today. It's an amazing piece of work, thank you.

Toggling the gutter no longer collapses the lines to the left

Toggling the gutter no longer collapses the lines to the left. This is easy to see using:
env.editor.renderer.setShowGutter(!env.editor.renderer.showGutter);

Resizing the window fixes them but strangely calling window.resize() doesn't. After resizing the window toggling the gutter again means that the line is on top of the gutter.

Fresh build fails: "Cannot find module 'uglify-js'"

tyson:ace[master⚡]$ npm link .
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info link /Users/tyson/git/ace
npm info ignoring invalid version [email protected]
npm info range dryice@>=0.1.0
npm info range uglify-js@>=0.0.2
npm info preinstall [email protected]
npm info preinstall [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info preactivate [email protected]
npm info activate [email protected]
npm info postactivate [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info preactivate [email protected]
npm info activate [email protected]
npm info postactivate [email protected]
npm info build Success: [email protected]
npm info build Success: [email protected]
npm info preinstall [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info preactivate [email protected]
npm info activate [email protected]
npm info postactivate [email protected]
npm info build Success: [email protected]
npm ok
tyson:ace[master⚡]$ ./Makefile.dryice.js 

node.js:63
    throw e;
    ^
Error: Cannot find module 'dryice'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/Users/tyson/git/ace/Makefile.dryice.js:39:12)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at Object.runMain (node.js:522:24)
    at Array.<anonymous> (node.js:756:12)
    at EventEmitter._tickCallback (node.js:55:22)
    at node.js:773:9

Make line numbers clickable

Make line numbers select the corresponding line(s). A click on
a line number would select a unique line while a click+extend would select all
the lines between the initial mousedown and the mouseup.
@Gissues:{"order":95.03105590062114,"status":"backlog"}

find+replace

Ace currently comes with a find command. It would be nice to also have a find+replace command.

Unescaped regexp character (Chromium)

Chromium browser version 10.0.610.0 gives me following error when I try the demo (demo/editor.html).
require.js:21 Uncaught SyntaxError: Invalid regular expression: /require("'["'])/: Invalid character range

It works after escaping the dash character in regexp, i.e changing line
cjsRequireRegExp = /require("'["'])/g,
to
cjsRequireRegExp = /require("'["'])/g,

editor's constructor focuses itself on creation

in acebug we are loading ace into separate iframe
and editor displays flashing caret even when iframe isn't focused
since there are no other focusable elements in iframe calling editor.blur doesn't help

this behavior can interfere with multiple editor instances as well
so, maybe, removing focus call from constructor and letting startup.js to decide will be better

Build a release package

I think we'll want a release package similar to what we offered for Bespin.

Contents:

  • prebuilt, ready-to-run .js file with HTML/JS/CSS highlighting
  • docs
  • complete source
  • dryice (for building custom builds)

The various components that go into the package are in other issues. This is sort of a metabug to actually generate the release tarball from those parts.
@Gissues:{"order":93.16770186335407,"status":"backlog"}

Editor initially not working in IE8

I just updated the editor and sadly the editor does only show the first line of code in IE8. After setting some new code, the editor seems to work as expected.

Turn themes into plugins

Currently, the themes are directly part of the ACE package. They should really be separate plugins.
@Gissues:{"order":95.6521739130435,"status":"backlog"}

Overrinded browser shortcuts are anoying

CMD + L opens jump to line dialog, which is annoying since it's quite frequently used as jump to location bar shortcut in Firefox :(

Can another non conflicting combination be used for that ?
@Gissues:{"order":96.89440993788821,"status":"backlog"}

Auto-close special characters

Like most other editors, you should at least have an option to auto-close special characters. e.g. typing function( should automatically convert it to function() or, typing a single quote should change it to 2 single quotes with your cursor in the middle, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.