Commit Graph

11154 Commits

Author SHA1 Message Date
Kevin Sawicki
da3b1a4881 Add root cache check in browser process 2015-02-12 14:22:44 -08:00
Kevin Sawicki
e9eb3d1d34 Remove old coffee cache 2015-02-12 14:22:44 -08:00
Kevin Sawicki
0738d456b5 Use coffee-cash module 2015-02-12 14:22:44 -08:00
Nathan Sobo
e739444800 Add an assertion when line is null in presenter
Refs #5527
2015-02-12 13:23:42 -07:00
Max Brunsfeld
723117a2dc 🎨 fix linter errors 2015-02-12 11:36:16 -08:00
Max Brunsfeld
8339819c7b Revert "Move reactCompat option to transform as per 6to5 deprecation warning."
This reverts commit 698b870491.
2015-02-12 11:33:05 -08:00
Michael Bolin
698b870491 Move reactCompat option to transform as per 6to5 deprecation warning.
Bumped the version of 6to5-core to `^3.6.0` to ensure `reactCompat` is
available as a transform rather than an option.
2015-02-12 11:29:14 -08:00
Max Brunsfeld
aa59c38264 Merge pull request #5491 from bolinfest/repository-provider
Set up the atom.repository-provider service and implement GitRepositoryP...
2015-02-12 11:00:05 -08:00
Nathan Sobo
26a66342dc Merge pull request #5519 from atom/ns-optimize-editor-presenter
Optimize TextEditorPresenter
2015-02-12 11:57:20 -07:00
Michael Bolin
5d788f9a6c Use getPath() instead of getRealPathSync() because other parts of Atom are relying on getPath() for contains(). 2015-02-12 10:45:20 -08:00
Ben Ogle
4a20dc9079 Return items from the opener, rather than using open
This way, options like `split: ‘left’` can be used with the config
URIs.
2015-02-12 10:43:35 -08:00
Nathan Sobo
b3d03d032a 🐎 Read TextEditor::cursors directly to avoid allocation 2015-02-12 11:34:45 -07:00
Nathan Sobo
205d1df7b4 Precompute ::startRow and ::endRow in presenter 2015-02-12 11:34:45 -07:00
Ben Ogle
dcbff35ef5 Handle EEXIST error with a better message
Closes #5518
2015-02-12 09:55:51 -08:00
Nathan Sobo
cc80378b29 Precompute ::scrollTop in presenter 2015-02-12 09:36:44 -07:00
Michael Bolin
5b03cfe878 Added unit test for Project::repositoryForDirectory and fixed the bug
that my unit test caught.
2015-02-11 22:38:02 -08:00
Nathan Sobo
4f5b989cbb Use property instead of non-existent method in OverlayManager 2015-02-11 23:04:49 -07:00
Nathan Sobo
54fcaa6132 Precompute ::scrollHeight and cache ::scrollPastEnd config value 2015-02-11 23:01:08 -07:00
Nathan Sobo
05554d03e4 Precompute ::scrollWidth 2015-02-11 22:53:38 -07:00
Nathan Sobo
fc603aaa0d Precompute ::clientHeight and ::clientWidth 2015-02-11 22:42:32 -07:00
Nathan Sobo
cf958ffeac Don’t cascade computed values unless upstream values change 2015-02-11 22:34:42 -07:00
Nathan Sobo
a3f902104c Precompute ::horizontalScrollbarHeight and ::verticalScrollbarWidth 2015-02-11 22:25:10 -07:00
Nathan Sobo
b6908b18b4 Precompute contentWidth 2015-02-11 22:06:11 -07:00
Nathan Sobo
be691b6a54 Precompute contentHeight and height 2015-02-11 22:04:05 -07:00
Nathan Sobo
6524da6594 🐎 Skip decoration marker changes if caused by text changes
We’re already updating all decorations when text changes anyway, so
marker changes caused by text changes don’t need to perform updates
again.
2015-02-11 19:41:39 -07:00
Kevin Sawicki
baf6795195 Use ATOM_HOME env var in protocol handler
Closes #5501
2015-02-11 12:20:24 -08:00
Nathan Sobo
e4168d70b7 Use computed clientWidth instead of contentFrameWidth as max scrollWidth 2015-02-11 11:47:18 -07:00
Michael Bolin
746fceb4ed s/repositoryPromisesByDirectory/repositoryPromisesByPath/g 2015-02-11 09:20:50 -08:00
Michael Bolin
1191db009e Addressing @nathansobo's feedback. 2015-02-11 09:17:25 -08:00
Nathan Sobo
009d945e1e Destroy TextEditorPresenter when unmounting TextEditorComponent
Fixes atom/find-and-replace#348
2015-02-11 09:02:33 -07:00
Nathan Sobo
98e126b40d Remove redundant require 2015-02-11 07:54:54 -07:00
Michael Bolin
e04f17fe5f Set up the atom.repository-provider service and implement GitRepositoryProvider.
I tested this by creating a dummy implementation of an `HgRepositoryProvider`
(with the optional `createRepositorySync()` method implemented) and an `HgRepository`
in an Atom package with the following stanza in the `package.json`:

```
  "providedServices": {
    "atom.repository-provider": {
      "versions": {
        "0.1.0": "createHgRepositoryProvider"
      }
    }
  },
```

I opened a path with an Hg repository from the command line using Atom.
I verified that `atom.project.repositoryProviders` contains both a
`GitRepositoryProvider` and an `HgRepositoryProvider`.

I also verified that running the following printed out an `HgRepository`:

```
var Directory = require('pathwatcher').Directory;
atom.project.repositoryForDirectory(
    new Directory(atom.project.getPath(), /* symlink */ false)).then(
        function(repo) { console.log('repo: %o', repo); });
```

One thing that stands out to me about the current API for the
atom.repository-provider service is that the function used to create
a `RepositoryProvider` does not receive any arguments. If the creation
of the `GitRepositoryProvider` were done via the service, this would
be a problem because it needs a reference to `atom.project`, which is
not defined when it is created. (We work around this because it is
created in `Project`'s constructor, so it can pass `this` to
`new GitRepositoryProvider()`.)

We would have to create a `RepositoryProviderFactory` or something if
we wanted to specify arguments when creating a `RepositoryProvider`,
in general. Maybe that's too crazy / not an issue, in practice.

Though note that `GitRepository` cannot access `atom.project` lazily
because it uses it in its constructor to do the following:

```
if @project?
  @subscriptions.add @project.eachBuffer (buffer) => @subscribeToBuffer(buffer)
```

So long as we can guarantee that `atom.project` is defined before the
other providers are initialized, I think we should be OK.

Follow-up work:
* Replace the use of `RepositoryProvider.createRepositorySync()` with
`RepositoryProvider.repositoryForDirectory()` in `Project.setPaths()`.
* Replace all uses of `Project.getRepositories()` with
`Project.repositoryForDirectory()` in packages that are bundled with Atom
by default.
* Implement `Directory.exists()` and/or `Directory.existsSync()` and update
`git-repositor-provider.coffee`, as appropriate.
* Eliminate `GitRepositoryProvider.repositoryForDirectory()`'s use of
synchronous methods.
* Somewhat orthogonal to this diff, but the following fields need to be
removed from `Project` because they enforce the idea of a single root:
`path`, `rootDirectory`, and `repo`. This has implications around the
existing use of `@rootDirectory?.off()` and `@destroyRepo()`.
2015-02-10 21:46:02 -08:00
Nathan Sobo
7f0110f49e Update cursors as soon as all required measurements are assigned 2015-02-10 15:16:58 -07:00
Nathan Sobo
f5294454e6 Keep a minimum of 3 lines on screen when scrolling past end 2015-02-10 14:38:20 -07:00
Nathan Sobo
3e9b48ef71 Expand computed scrollHeight when editor.scrollPastEnd is enabled 2015-02-10 14:19:06 -07:00
Nathan Sobo
746950a347 Default overdrawMargin to 15 even when passed as null from outside 2015-02-10 12:39:34 -07:00
Nathan Sobo
884556c200 Revert "Don’t override lineOverdrawMargin with null"
This reverts commit 04cb43d657.
2015-02-10 12:39:34 -07:00
Nathan Sobo
04cb43d657 Don’t override lineOverdrawMargin with null 2015-02-10 10:15:44 -07:00
Nathan Sobo
a4fd589616 Don’t render line numbers if scrolled past end 2015-02-10 10:11:20 -07:00
Nathan Sobo
711f0a227c Honor the editor.scrollPastEnd option in TextEditorPresenter 2015-02-10 09:47:24 -07:00
Nathan Sobo
89d5dd339e Merge pull request #5293 from atom/ns-editor-presenters
Move all text editor view state into a presenter object
2015-02-09 15:43:14 -07:00
Nathan Sobo
48195851d4 Assign line and character measurements on model via presenter 2015-02-09 15:32:14 -07:00
Nathan Sobo
4f0e1997cf 💄 CharWidth -> CharacterWidth in presenter 2015-02-09 15:28:17 -07:00
Nathan Sobo
d5719bfbd5 Initialize scopedCharacterWidthsChangeCount to 0 2015-02-09 15:03:31 -07:00
Nathan Sobo
bdfca8b902 Coalesce handling style sheet changes in editor with nextAnimationFrame
Previously, we were delaying handling, but still requesting redundant
handling by requesting multiple frames. Now we don’t request a new
update if there is already one outstanding.
2015-02-09 14:36:30 -07:00
Nathan Sobo
df01c8ab6f Batch scoped character measurement in presenter 2015-02-09 14:33:18 -07:00
Max Brunsfeld
ef9ae8e7d7 Merge pull request #5404 from atom/mb-integration-test
Add integration test to cover browser-side code
2015-02-09 13:11:53 -08:00
Nathan Sobo
0d1ba90561 Update presenter’s gutter background state when background color changes 2015-02-09 13:54:25 -07:00
Nathan Sobo
62c8244bf2 Merge branch 'master' into ns-editor-presenters 2015-02-09 13:37:27 -07:00
Kevin Sawicki
ac1cc87037 Use custom document to create test elements 2015-02-09 09:35:38 -08:00