Commit Graph

2066 Commits

Author SHA1 Message Date
Justin Palmer
b2ce4ca6d5 merge dev, fix conflicts from package rewrite 2013-02-09 20:17:29 -08:00
Kevin Sawicki
fbd9f3b174 Remove unused variable 2013-02-09 12:51:52 -08:00
Kevin Sawicki
75a9bce848 Support packages with CSON grammars 2013-02-09 12:41:51 -08:00
Corey Johnson & Kevin Sawicki
4619e1847f Manage package lifecycle in Atom instead of in RootView 2013-02-08 17:28:08 -08:00
Corey Johnson & Kevin Sawicki
c27489f608 Remove name parameter from RootView.activatePackage 2013-02-08 17:28:08 -08:00
Corey Johnson & Kevin Sawicki
ed0ced205b Store packages in array instead of a hash by name 2013-02-08 17:28:08 -08:00
Corey Johnson & Kevin Sawicki
8434bdfe91 Load package's configDefaults in AtomPackage
This was previously loaded in RootView.
2013-02-08 17:28:08 -08:00
Corey Johnson & Kevin Sawicki
b93f404fa1 Store packages instead of package modules in RootView 2013-02-08 17:28:07 -08:00
Corey Johnson
14cfa22d22 Only require packages that have a main module 2013-02-08 17:28:07 -08:00
Kevin Sawicki
e419ec1848 Migrate fixtures package to not extend AtomPackage 2013-02-08 17:28:07 -08:00
Corey Johnson & Kevin Sawicki
ac6ec1c2a7 Remove rootView as parameter to activate 2013-02-08 17:28:07 -08:00
Corey Johnson & Kevin Sawicki
9043f8290f Deactivate rootView in afterEach 2013-02-08 17:28:06 -08:00
Corey Johnson & Kevin Sawicki
3c36eaf454 Un-f spec 2013-02-08 17:28:05 -08:00
Corey Johnson
6f05e66825 Add rootView to atom spec to eliminate warnings 2013-02-08 17:28:04 -08:00
Kevin Sawicki & Nathan Sobo
641a0d43cc Retrigger event after package module is activated
The event that triggers the package module to be activated is
now retriggered after the package module is initialized but without
any previously registered handlers. Instead only the handlers registered
by the package module will be triggered.  The prior event handlers are then
restored after the event is retriggered.

This allows package modules to bind event handlers during initialization
that will be triggered by the same event that caused the package module
intialization to occur.  This simplifies the common case of having the same
event cause a package module to initialize and attach.
2013-02-08 17:28:04 -08:00
Corey Johnson & Kevin Sawicki
3b4f07701b Build packages using paths instead of filenames 2013-02-08 17:28:04 -08:00
Corey Johnson
a89fdd7714 Reset the loadedPackages before each test.
Also stop including fixturePackagesPath in configs.packageDirPaths. Instead load fixture packages as needed
2013-02-08 17:28:03 -08:00
Corey Johnson
74ae4a6413 Remove getTextMatePackages 2013-02-08 17:28:03 -08:00
Nathan Sobo
1cab51cefa RootView can no longer be focused.
Allowing root view to be focused was stealing focus away from the
editor whenever a click event made it to the root view. This unnecessary
switching of focus was interfering with the ability to drag tabs.

But if RootView can't be focused, focus ends up being returned to the
document body when there are no focusable elements. This would be fine,
except for the fact that we frequently bind global events on root view,
and so they aren't triggered when events are triggered on the body. We
could just bind all global events on the body, but this would require
us to always attach elements to the DOM during specs, which is a serious
performance killer in specs.

The workaround is in the keymap. When the keymap handles a key event
that was triggered on the body, it triggers the corresponding semantic
event on the root view anyway, so from the event perspective, it's as
if the root view actually had focus. The only place this might fall
down is if someone wants to capture raw key events. But that's the
keymap's job anyway, and we maybe add a hook on the keymap if such a
need ever arises.
2013-02-08 17:33:37 -07:00
Nathan Sobo
6e191aba5b Move matching bracket insertion to bracket-matcher package 2013-02-08 09:51:31 -07:00
Nathan Sobo
4fdb1c454e Restore marker cleanup assertions
Now that EditSessions clean up their markers, we can pass these tests
again.
2013-02-06 17:29:08 -07:00
Nathan Sobo
0bd98bf8f8 Do a better job cleaning up after Editors and EditSessions
- EditSessions destroy their Selections when they are destroyed
- Editors destroy their EditSessions when they are destroyed
- Editors unsubscribe from the document and window when they are
  removed from the DOM.
- When an EditSession is destroyed via any code path, the Editor with
  that EditSession removes it.
- Selections no longer trigger 'destroyed' events if their parent
  EditSession has already been destroyed.

These are all really intertwined, so I'm doing them as one commit
since that was the only way to keep the specs green.
2013-02-06 16:54:19 -07:00
Kevin Sawicki & Nathan Sobo
59d0742c17 Remove Anchor and AnchorRange. They're fully replaced by markers.
We're still leaking markers for selections and cursors. We need to
clean that up before merging.
2013-02-05 18:15:48 -07:00
Kevin Sawicki & Nathan Sobo
13183639b6 Ensure the cursor becomes visible when the selection is emptied
(Even if the cursor doesn't move)
2013-02-05 17:06:56 -07:00
Kevin Sawicki & Nathan Sobo
85111748ec Reset spy in spec before making next assertion 2013-02-05 16:34:36 -07:00
Kevin Sawicki & Nathan Sobo
5a1de9fa44 Add specs for truthiness of marker position assignment return values 2013-02-05 16:33:59 -07:00
Kevin Sawicki & Nathan Sobo
75e040b73b Merge remote-tracking branch 'origin/dev' into markers
Conflicts:
	src/app/editor.coffee
2013-02-05 16:07:05 -07:00
Kevin Sawicki & Nathan Sobo
94d1edcc06 Add EditSession.selectMarker 2013-02-05 15:54:20 -07:00
Kevin Sawicki & Nathan Sobo
c893f0c338 Add Buffer.markersForPosition and coerce marker ids to strings 2013-02-05 15:50:54 -07:00
Kevin Sawicki & Nathan Sobo
240e893d33 Don't emit a cursor-moved event when only the tail of the marker moves 2013-02-05 15:19:10 -07:00
Kevin Sawicki
3e84e9886c Break out event handler setup into separate method
This mirrors the keymap setup method and allows specs
to reattach handlers after calling shutdown()
2013-02-05 13:17:53 -08:00
Kevin Sawicki
ba811c4119 Un-f a window spec 2013-02-05 12:59:26 -08:00
Justin Palmer
8512bee6c9 merge dev, fix conflicts 2013-02-05 12:42:44 -08:00
Nathan Sobo
1d30605f7f Convert selection and cursor fully over to markers. 2013-02-05 13:39:00 -07:00
Kevin Sawicki
8de45ccc21 Bind meta-D to duplicate line below
Refs #134
2013-02-05 12:16:50 -08:00
Kevin Sawicki
ad3c18077c Compare against EOF position when clipping
Previously the column could potentially be set to
zero since a Math.min comparison was used for the
length of an already adjusted row.
2013-02-05 12:08:17 -08:00
Justin Palmer & Nathan Sobo
65927ea0cf fix window blur and focus events 2013-02-05 12:03:56 -08:00
Justin Palmer
22770bd663 add onBlur and onFocus events for the window
This allows us to simulate those events and test for them easier
2013-02-05 10:53:35 -08:00
Nathan Sobo
afe0a6570a Reduce observation to single observeMarker method on display buffer
It will call the observer callbacks with the buffer and screen positions
of the head and tell each time any of these values is changed.
2013-02-04 21:24:06 -07:00
Nathan Sobo
58450d6a65 Give Buffer only a single observeMarker method
It will fire the callback whenever the marker's head or tail position
changes, and it's up to the subscriber to use the information how they
want to.
2013-02-04 20:35:30 -07:00
Nathan Sobo
852b4c2f8a Merge remote-tracking branch 'origin/dev' into markers 2013-02-04 20:04:01 -07:00
Justin Palmer
eb8d6f9766 fix textmate editor specs 2013-02-04 17:07:27 -08:00
Justin Palmer
4350be62c6 💀 is-focused.
targeting blurred state instead so normal state styles don't need a
special prefix
2013-02-04 16:02:09 -08:00
Justin Palmer
7a2a02dacf Merge pull request #227 from github/cut-dat-fat
Reusable styles for common UI elements
2013-02-04 15:39:22 -08:00
Kevin Sawicki
bef965d863 Add line number padding to expected width 2013-02-04 15:35:40 -08:00
Kevin Sawicki
bd88a0de15 Support CSON config file
Use ~/.atom/config.cson as the new default when no
config file exists.

~/.atom/config.json is still the default if they both
exist.
2013-02-04 12:38:00 -08:00
Kevin Sawicki
cd07ec841d Add more window globals and shims in task shell
This allows jQuery to be successfully loaded from a web worker
since it does not have a document or window object by default.

Previously it would log about missing methods and properties.

Closes #228
2013-02-04 11:43:58 -08:00
Nathan Sobo
ead93d0f39 Rename to DisplayBuffer.observeMarkerHeadPosition
When you observe, you get callbacks whenever the screen or buffer
position changes, and you get the new and old position in both 
coordinate types.
2013-02-04 11:32:47 -07:00
Nathan Sobo
44e48d42ea Add Buffer.observeMarkerRange 2013-02-04 11:27:39 -07:00
Kevin Sawicki
84feaf369d Format undefined array values as null 2013-02-04 09:08:00 -08:00