

Edit like an Ace - sant0sk1
https://github.com/blog/905-edit-like-an-ace

======
simonsarris
For those following Canvas projects it is worth noting the history here, that
Mozilla Bespin became Mozilla Skywriter and then ditched HTML5 Canvas
altogether for divs only, finally merging with Ace.

~~~
forgotusername
Have you got any links/pointers as to why they switched? I remember their use
of canvas being a strategic design choice early on (with IIRC, a list of
reasons why just using the DOM wouldn't work so well)

~~~
simonsarris
Implementing good text controls in Canvas is a fool's errand. The spec itself
warns against it:

[http://www.whatwg.org/specs/web-apps/current-
work/multipage/...](http://www.whatwg.org/specs/web-apps/current-
work/multipage/the-canvas-element.html#best-practices)

They wanted to be ambitious and to their credit they got very far. They gave a
few talks on the hurdles they had to overcome. Measuring the height of text,
making their own custom scrollbars, resizing woes, etc. They did a good job
with a lot of it.

They admitted it was fun but too hard to get everything right. They ran into
most of the problems in the spec: "Unlike Skywriter, Ace uses the DOM to
render instead of the <canvas> element making it compatible with a wider range
of browsers and potentially giving it a leg up in accessibility."

[http://mozillalabs.com/skywriter/2011/01/18/mozilla-
skywrite...](http://mozillalabs.com/skywriter/2011/01/18/mozilla-skywriter-
has-been-merged-into-ace/)

The code for Skywriter was actually really good. I used a lot of it to make my
in-canvas scrollbars before moving on to my own code.

------
dotBen
By having this tied into github I'm beginning to see how use Ace (or similar)
instead of vim/emacs as a day-to-day code edit workflow...

Just fork a project to your account on github, edit in Ace, and then make a
pull request when you are done.

Would people do this? If not, is Ace just going to be for minor edits, etc?

I'm curious how other people will use this.

EDIT: people the child comments are telling me the fork is done automatically
for you - cool. I need to play around with this on other projects!

~~~
rtomayko
Just wanted to note that a fork is automatically created and a pull request
created when you edit a file in a repository you don't have push access to. So
the workflow is even simpler: 1.) see file, 2.) edit file and save, 3.) land
on send pull request page.

~~~
ithkuil
great. But perhaps a fork is still needed for editing multiple files and
submitting as one pull request?

or the pull request would accumulate changes?

I cannot reproduce but I noticed a situation when I was issuing multiple pull
requests and the previous pull request somehow got commits that weren't
intended to end up there; so I begin to think that it was intentional.

(just asking because I would like to avoid creating a tmp github account just
to try that out, otherwise I wouldn't bother you with silly questions)

~~~
albertsun
Pull requests do seem to accumulate changes if you push to your fork while
there's one open.

------
compay
I'm really happy to see this feature. Sometimes I see a small problem in
somebody else's code or documentation and out of sheer laziness I don't go
though the trouble of forking, cloning, editing, pushing and sending a pull
request. I think this will be wonderful for exactly those situations and
should help encourage more people to participate in open source.

~~~
niels
The edit feature has been there for a long time. They have added an improved
editor.

~~~
bryanlarsen
Is github is speeding up even internet time? The edit button was only added to
unowned repositories at the end of April.
<https://github.com/blog/844-forking-with-the-edit-button>

~~~
technoweenie
That blog post is about automatically forking with edit. The edit button was
discovered by our users nearly 3 years ago:
<https://github.com/blog/143-inline-file-editing>

~~~
bryanlarsen
forking with edit is what the parent comment was talking about.

------
pepijndevos
I can see how this might silently make Github into one of the best blogging
platform on the planet.

I run my blog (pepijndevos.nl) on Github, using its Jekyll feature, so my blog
just got a much better online editor with preview functionality.

------
xyzzyz
I've checked Ace live demo[1], turned on "Emacs" keybindings and failed to see
what do they have in common with Emacs, apart from the old, carpal-tunnel-
syndrome-powered C-p/n/b/f movement keys.

They could use an Emacs hacker to fix it up, but Emacs hackers already have
perfectly fine editor, so I do not predict any great success in this field.

[1] - <http://ajaxorg.github.com/ace/build/kitchen-sink.html>

~~~
kemayo
The Vim bindings have the same issue. Sure, it's modal, and you have to hit
`i` before you can insert text... but there's nearly no features when you're
not in insert mode. The only one I was able to trigger off the top of my head
was using `dd` to delete a line... and it didn't even yank it, so p wouldn't
paste it back in. No searching, no undoing, no applying commands to multiple
lines, no `.` to repeat the last action...

Like the emacs mode, it feels like it was implemented to check a feature off
on a list, not because someone wanted to take advantage of the things that
vi/emacs do well.

~~~
kemayo
Well, I went in and submitted a pull request that'll at least give it undo as
a binding and [count] args on the existing commands that it's appropriate for.

<https://github.com/ajaxorg/ace/pull/381>

------
Skywing
This is neat editor and it's cool to see how Github could eventually bill
itself as your one stop shop for code editing and collaboration. My only
concern is that of feature creep hurting the user experience by creating a
cluttered and confusing UI. I personally feel that Github's web UI is very
cluttered as it is. They possibly have one of the best user experiences that I
have seen, given the large amount of data and information that they have to
present and I do not think that this feature necessarily hurts it at all, but
it's getting close, in my opinion.

Just my two cents.

------
DanielRibeiro
It would be great if it gets collaborative real time editting.

~~~
oscilloscope
Check out ShareJS:

<https://github.com/josephg/ShareJS>

------
sry_not4sale
Wow, I'm in love with the idea of a "preview" tab showing you a git diff!

Would love to see this feature given 1st class attention in other editors!

~~~
josephcooney
Agree. Why in this day and age I need to fire up an external tool to look at
diffs is beyond me. I appreciate the external tool exists (for times when I'm
NOT in my editor/IDE to begin with) but I'd rather it was all baked in.

~~~
sry_not4sale
Even if it git or another scm wasn't available - just a diff of changes since
the file was opened in the editor...

------
vmind
I've contributed some changes and documentation to Ace, really awesome
project, great to see it hitting Github!

Support for IE<9 older browsers is a little sketchy at the moment, but
hopefully greater exposure through github will see more fixes and features
contributed. (Fabian Jakobs seems quite open to new features as long as they
fit in with the projects goals)

------
reustle
I was already a huge fan of the Bespin / Cloud9ide / ace projects so this is
great news!

------
keyle
This is great! I'm currently working on a small web editor called anyfnwhere.
In development at the moment.

check <https://github.com/keyle/anyfnwhere>

------
AshleysBrain
From TFA: "If you're using a recent version of Safari, Chrome, or Firefox
here's how it works.."

Is there a reason they miss out Internet Explorer? Makes it sound like it's
not supported or something. Is it?

~~~
kiiski
Apparently IE and Opera use the old editor.

------
jarek-foksa
I wonder why they have chosen Ace over CodeMirror. CodeMirror has very similar
set of features, is less bloated and works on more browsers.

------
Newky
This is a brilliant feature, and as close an example of cloud editing that I
would consider using as any on the internet.

Does anyone know is there anything to give this a modular editor feel like
vim?

If someone can deliver me an online experience with a fully functioning vim, I
would be browser bound almost exclusively.

------
NHQ
I use cloud9, and love it.

------
mbrzuzy
Finally there is support for this! I'm excited.

------
tedjdziuba
No.

C-x k

------
enherit
Just learn vim.

