Commit Graph

2085 Commits

Author SHA1 Message Date
Nathan Sobo
81145eb35f Initial support for variable width fonts
When translating a logical screen position (columns/rows) to a pixel
position, the editor now builds a temporary version of the line for the
given row. It then uses the DOM range API to insert an empty range
at the correct text node and offset for the given column and determines
the left position based on its clientRect.

Depending on the speed impact, we may want to optimize this by
recycling the existing line node if it exists on screen rather than
building a new one every time. We will still have to build one if the
line we're moving to isn't on screen yet. We could also increase the
chances of the line being on screen by autoscrolling to the vertical
position first, and *then* calculating the horizontal position. Lots
to explore here.
2013-02-12 17:07:14 -07:00
Kevin Sawicki
8922a27eb3 Subtract skipped count from complete and total counts 2013-02-12 15:52:00 -08:00
Kevin Sawicki
07c5a94613 Remove unused packages ivar 2013-02-12 15:47:31 -08:00
Kevin Sawicki
2910a90916 Round spec time to 2 decimal points 2013-02-12 14:48:16 -08:00
Kevin Sawicki
5f84ec711b Add class to hard tabs and leading/trailing spaces
This allows whitespace to be still be styled when invisibles
are disabled.
2013-02-12 13:25:22 -08:00
Kevin Sawicki
d234c8fdce Don't track closed sessions with no path 2013-02-12 11:20:21 -08:00
Kevin Sawicki
eceabf0e31 Add spec for clearing opened session from undo stack 2013-02-12 11:17:43 -08:00
Kevin Sawicki
5ecbda0aac Restore closed tab at previous index 2013-02-12 09:41:32 -08:00
Jon Rohan
c43a1e5ce5 Undo last closed tab 2013-02-12 08:56:39 -08:00
Kevin Sawicki
1ee1fa02ba Merge pull request #255 from github/rearrange-tabs
Drag and drop tabs
2013-02-12 08:38:52 -08:00
Kevin Sawicki
9057f044bf Add specs for Editor.moveEditSessionToEditor 2013-02-11 21:01:21 -08:00
Kevin Sawicki
9eae796be3 Add move edit session specs 2013-02-11 20:54:04 -08:00
Kevin Sawicki
c9fae85375 Rename moveEditSessionAtIndex to moveEditSessionToIndex 2013-02-11 20:29:48 -08:00
Corey Johnson
06e96cc346 Fold failed specs on click 2013-02-11 20:23:42 -08:00
Kevin Sawicki
a104e67acd Support moving an edit session's editor index 2013-02-11 18:36:50 -08:00
Corey Johnson
98cd5b46d1 Spec runner cleanup 2013-02-11 18:00:56 -08:00
Kevin Sawicki
e952a68c96 Support setting working directory of child process 2013-02-11 14:53:53 -08:00
Kevin Sawicki
a61b0ab9da Toggle dev tools in spec helper when no root view
Previously the keybinding for toggling the dev tools
would not function correctly after the root view had
been destroyed.
2013-02-11 10:22:19 -08:00
Kevin Sawicki
76a6ab9f03 Support loading CSON snippets from TextMate bundles 2013-02-11 09:29:48 -08:00
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