Commit Graph

2399 Commits

Author SHA1 Message Date
Kevin Sawicki & Nathan Sobo
4a6f05ae4e Trigger 'pane:active-item-changed' on Pane
This event is triggered when the item changes on the active pane, or
when a different pane becomes active.

Also: Pane now sets itself as the active pane, rather than letting
PaneContainer handle the focusin event.
2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
ad62f896bc Make Pane maintain a currentView pointer based on its current item 2013-03-07 09:30:21 -08:00
Kevin Sawicki & Nathan Sobo
d310fb366f Remove references to RootView from editor spec 2013-03-07 09:30:21 -08:00
Nathan Sobo
486baa393b PaneContainer.getActivePane returns the most recently focused pane 2013-03-07 09:28:52 -08:00
Nathan Sobo
2ba63e608f Don't allow core:close event to bubble out of Pane 2013-03-07 09:28:52 -08:00
Nathan Sobo
8f980a0f20 Replace Editor's next/previous edit session bindings w/ pane bindings 2013-03-07 09:28:52 -08:00
Nathan Sobo
bd8ec81b1e Make Pane close the current item when handling 'core:close' event 2013-03-07 09:28:52 -08:00
Nathan Sobo
11a702a2a6 Remove pane when its last item is removed 2013-03-07 09:28:52 -08:00
Nathan Sobo
7d147dd2ce Make Pane handle split commands instead of Editor 2013-03-07 09:28:52 -08:00
Nathan Sobo
fee835f899 Add a PaneContainer subview for RootView
PaneContainer is responsible for all pane-related logic. Laying them
out, switching focus between them, etc. This should help make RootView
simpler and keep pane-layout related tests in their own focused area.
2013-03-07 09:28:52 -08:00
Nathan Sobo
9ecb03e470 Rename PaneGrid to PaneAxis
PaneGrid is a superclass of PaneRow and PaneColumn. These are both
a type of axis for the pane layout system.
2013-03-07 09:28:52 -08:00
Nathan Sobo
19e2cab920 💄 2013-03-07 09:28:52 -08:00
Nathan Sobo
0c2a5f273c Enhance pane split methods. Spec them in pane-spec.
When a pane is split, it attempts to make a copy of its current item
if no items are passed to the split method. When splitting, multiple
items can also be passed to the constructor of the new pane.
2013-03-07 09:28:52 -08:00
Nathan Sobo
45eec6a8ff Get more specs passing. Failing specs due to missing features. 2013-03-07 09:28:52 -08:00
Nathan Sobo
281a28bb0e Add spec for pane focusing the its current item view when it's focused 2013-03-07 09:28:52 -08:00
Nathan Sobo
568fcf441e Pane serializes its serializable items 2013-03-07 09:28:52 -08:00
Nathan Sobo
bee1efed5c Make RootView.open work with new Pane behavior
Still a bit of a WIP. Panes don't yet take the "active" class
correctly when focused.
2013-03-07 09:28:51 -08:00
Nathan Sobo
829bfa0a10 Add Pane.itemForPath 2013-03-07 09:28:51 -08:00
Nathan Sobo
62729c42ee Panes destroy their items when they are removed
As a consequence of these changes, editors will no longer need to
listen for destruction of their edit sessions. An editor will
eventually only ever be displaying a single edit session, and the
editor will destroy that edit session when it is removed. Panes
will be responsible for supporting multiple edit sessions, and
they will automatically remove the editor when they have no more
edit session items.
2013-03-07 09:28:51 -08:00
Nathan Sobo
77bf3e4d74 Get root view pane specs passing 2013-03-07 09:28:51 -08:00
Nathan Sobo
d89a7eb522 When showing an item on a pane, add it to the items list if needed 2013-03-07 09:28:51 -08:00
Nathan Sobo
41f18ee6a2 Add Pane.removeItem 2013-03-07 09:28:51 -08:00
Nathan Sobo
ef0c62f532 Add show next / previous item. 2013-03-07 09:28:51 -08:00
Nathan Sobo
372393d9ca Allow panes to have model objects as items in addition to views
The problem I've been struggling with is that we need to potentially 
assign tabs both to EditSessions and also to other views added by
extensions, like a markdown preview view. EditSessions are however not
actually views… instead they plug into editors. The solution is to
have the pane ask a model object what view should be used to render
it. When asked to show a non-view item, the pane constructs and
appends a view for that item or recycles an appropriate view that it
has already appended.
2013-03-07 09:28:51 -08:00
Nathan Sobo
2bdc077d2a Construct Pane w/ multiple items. Show first item on construction. 2013-03-07 09:28:51 -08:00
Nathan Sobo
beaeac4425 Rename buildEditSessionForPath to buildEditSession
Since this is the more external method, having a shorter name
is more convenient. The former `buildEditSession` method took a
Buffer, and is now called `buildEditSessionForBuffer`.
2013-03-07 09:28:51 -08:00
Kevin Sawicki
8af55a04d8 Use a single worker for status refreshes
There still appear to be crashes occurring when
using libgit2 from multiple workers at the same time.

So only start a new status worker once the current one
completes if a refresh was requested while a worker was
running.

Closes #367
2013-03-06 14:59:12 -08:00
probablycorey
081e3a459f Replace Consolas with PCMyungjo in spec 2013-03-05 15:55:38 -08:00
Corey Johnson & Kevin Sawicki
7eee81cd6a Return early when clipping tokenless screenline
Closes #337
2013-03-05 10:44:15 -08:00
Corey Johnson & Kevin Sawicki
94099358f3 Inserting whitespace never auto-outdents
Closes #340

Shout out to @nathansobo
2013-03-05 10:19:24 -08:00
probablycorey
37e4091723 💩 2013-03-05 10:13:18 -08:00
probablycorey
17fc679b25 Trigger resize event on editor before wrap guide specs 2013-03-05 09:43:38 -08:00
Kevin Sawicki
1c09a1352b Return {} when object is empty 2013-03-05 08:46:17 -08:00
Kevin Sawicki
5ddea28d80 Wrap objects inside arrays in {} 2013-03-05 08:42:24 -08:00
Kevin Sawicki
c14aa3b86f Default status to 0 if undefined
This keeps the status-changed event from triggering
the first time the status is requested as it goes
from undefined to 0 which should be treated as no
change.
2013-03-04 21:43:34 -08:00
Kevin Sawicki
3852b7212b Remove git-status-changed event from Buffer
This is now fired as a status-changed event from
the Git class when the checkout completes normally
and the status of the path changes.
2013-03-04 21:43:33 -08:00
Kevin Sawicki
31690d16ec Remove unused import 2013-03-04 21:43:33 -08:00
Kevin Sawicki
4fe6db240b Consolidate Git status checking
Now the status bar and tree view both listen for
status change events and use the cached information
available from the git object to update their views.
2013-03-04 21:43:33 -08:00
Kevin Sawicki
2ec4d558ba Make project's Git repository a window global
This allows it to operate independently of the
project and mirror the availability of the root view
and project.
2013-03-04 21:43:33 -08:00
Kevin Sawicki
68b61d71c6 Trigger event when path status changes 2013-03-04 21:43:32 -08:00
Kevin Sawicki
c6e89d33f8 Git.refreshStatuses() -> Git.refreshStatus() 2013-03-04 21:43:32 -08:00
Kevin Sawicki
50bc1aac74 Add task to refresh status of repository
By default this will occur when the window gains
focus and the Git class can now be subscribed to
so listeners can become notified when the status
of a repository changes.
2013-03-04 21:43:32 -08:00
Kevin Sawicki
4add7b6213 Support getting status of entire repository
New Git.getAllStatuses() method returns all non-ignored
status entries in the repository.
2013-03-04 21:43:32 -08:00
probablycorey
30d4cb81b8 Use Courier as the default font for specs
Fixes #323
2013-03-04 16:40:02 -08:00
probablycorey
b7976cac68 Use the /Applications directory to test cwd on Child Processes 2013-03-01 13:54:19 -08:00
Corey Johnson
595cf71d93 Return absolute path for Git repo 2013-03-01 13:54:19 -08:00
Corey Johnson & Kevin Sawicki
ec2f59836a Make patch version segment optional in spec 2013-02-28 10:15:24 -08:00
Adam Roben
eb0f118cd0 Remove "[object Object]" output from tests 2013-02-28 08:36:35 -05:00
Kevin Sawicki
745a3ef9f2 Use class methods to create native object shims
CoffeeScript 1.5 complains if a constructor has
a returns a value.
2013-02-27 13:25:10 -08:00
Kevin Sawicki & Nathan Sobo
5b990cf571 Add the 'between' invalidation strategy for markers
This invalidates markers when the start or end point of the changed 
range is between the head and tail position of the marker.
2013-02-26 17:42:47 -07:00
Kevin Sawicki & Nathan Sobo
e858f7eb2a Replace stayValid option w/ validationStrategy when creating markers 2013-02-26 17:03:02 -07:00
Kevin Sawicki & Nathan Sobo
42fe87a9a2 Notify observers when display buffer markers are invalidated 2013-02-26 14:59:09 -08:00
Kevin Sawicki & Nathan Sobo
e36887900f Notify observers when markers are invalidated/revalidated 2013-02-26 14:31:42 -08:00
Corey Johnson & Kevin Sawicki
f8563a1509 💄 2013-02-26 09:04:02 -08:00
Corey Johnson
ad14e65ef9 Add atom.getVersion(callback) 2013-02-25 14:58:11 -08:00
Kevin Sawicki
2f331b4377 Set font-size of fold marker to .8em
This keeps the line height of the gutter the same
as the line height of the editor for folded lines.

Closes #304
2013-02-25 09:49:53 -08:00
Kevin Sawicki
9b231e8c4e Add increase indent pattern for GFM scope 2013-02-25 08:58:47 -08:00
Kevin Sawicki
d35c871e17 Install atom executable during window.startup()
Previously this was done during `rake install`.

Also default to `~/github/atom` as the default resource path
when no `--resource-path` argument is specified.  This argument
will now be required when running in dev mode if the repository
is not at the default location.

Closes #300
2013-02-22 21:19:34 -08:00
Corey Johnson & Kevin Sawicki
2c986fdbfc Fix race condition in spec 2013-02-22 16:31:50 -08:00
Corey Johnson & Kevin Sawicki
31d8151c3e Copy themes to ~/.atom/themes when config loads 2013-02-22 14:46:30 -08:00
Corey Johnson & Kevin Sawicki
fa81871907 Initialize ~/.atom when config is loaded
Closes #299
2013-02-22 14:46:30 -08:00
Kevin Sawicki & Nathan Sobo
5da5bf94b6 Add 'editor:save-debug-snapshot' command. Closes #191.
This saves the state of the rendered lines, the display buffer, the
tokenized buffer, and the buffer to a file. If a problem arises with
rendering, hopefully we can use it to diagnose in which layer things
went awry.
2013-02-22 14:28:04 -07:00
Corey Johnson
4db982f9e5 Use a 5 second timeout for specs
Hopefully this is temporary.
2013-02-20 16:28:05 -08:00
Corey Johnson
211d18bf99 Listen for file events before acting on the file. 2013-02-20 16:27:30 -08:00
Kevin Sawicki
df3c00ac9c Remove console log call in spec 2013-02-20 15:50:31 -08:00
Kevin Sawicki
2457e7f5b2 Add indent guide to whitespace lines
The whitespace in lines that have no non-whitespace
text is treated as trailing whitespace so add the
indent guide to the trailing whitespace tokens when the
line is 100% whitespace.
2013-02-20 15:40:44 -08:00
Kevin Sawicki
1db21c91cc Give first line regex the required amount of lines
Certain bundles require multi-line matches in the firstLineMatch
value so count the number of newlines in the regex and only test
the regex against only those lines.
2013-02-20 15:11:07 -08:00
Kevin Sawicki
881efd9c5d Restore selection when undoing an insert newline below 2013-02-20 14:09:40 -08:00
Kevin Sawicki
af58c1e83f Bind meta-shift-enter to insert newline above current line
Closes #292
2013-02-20 13:44:30 -08:00
Corey Johnson
e0212ba02b Only use the first line when determine the syntax via file contents 2013-02-20 12:46:53 -08:00
Kevin Sawicki
27f44fbfd7 Invalidate empty lines proceeding a change event
The indent guide on empty lines will now be updated when
the non-empty line preceeding the empty lines is updated.
2013-02-20 12:20:15 -08:00
Kevin Sawicki
101b1aba12 Add indent guide to editor
The guide displays a continuous vertical line across lines with
the same indent levels.

Closes #50
2013-02-20 12:20:15 -08:00
Kevin Sawicki
2f797bfc7a 💄 the spec indentation 2013-02-20 12:20:15 -08:00
Corey Johnson & Nathan Sobo
c03b3fa691 💄 2013-02-20 11:44:50 -08:00
Corey Johnson & Nathan Sobo
5c1fb99037 Requiring window no longer has no side-effects
Call window.setUpEnvironment instead.
2013-02-20 11:44:39 -08:00
Corey Johnson & Nathan Sobo
2123fabae6 Window is only shutdown if a rootView and project exist
Keeping the shutdown state as a local var in window.coffee causes spec failures because window.shutdown can only be called once in the entire spec suite
2013-02-20 11:31:36 -08:00
Corey Johnson & Nathan Sobo
b24a13991a Make sure window.shutdown is only called once 2013-02-20 10:18:19 -08:00
Corey Johnson & Nathan Sobo
43aa1aaeb7 Rename startApplication to startup and stopApplication to shutdown 2013-02-20 10:02:16 -08:00
Corey Johnson & Nathan Sobo
f5ecaf436e Move core:close into handleWindowEvents 2013-02-20 09:58:34 -08:00
Corey Johnson & Nathan Sobo
cb1e48bfef Make toggle-dev-tools command work in spec window 2013-02-20 09:58:00 -08:00
Kevin Sawicki
dedde7b222 Only add newline when insert row exceeds last row
Previously if the line before a trailing newline was
duplicated an extra newline would inserted with the
duplicated line.
2013-02-19 21:02:25 -08:00
Kevin Sawicki
d27bbee37d Support selecting editor lines from the gutter
Mouse events that occur in the gutter are forwarded to the
rendered lines with the y-coordinate translated to be the
leftmost pixel of the editor to simulate the event originating
from column 0 of the current line row.

Closes #287
2013-02-19 18:16:29 -08:00
Corey Johnson & Nathan Sobo
9e8831f710 RootView.initialize no longer assigns window.rootView or calls open 2013-02-19 18:26:50 -07:00
Corey Johnson & Nathan Sobo
0b5ea8578f Eliminate rootView.project references. 2013-02-19 18:26:50 -07:00
Nathan Sobo
7f2747ead0 Make project a global and refactor startup process 2013-02-19 18:26:50 -07:00
Nathan Sobo
9cd6fda3e1 💄 add trailing newlines 2013-02-19 10:02:09 -07:00
Nathan Sobo
7bdd51b456 Rename deserializeView to deserialize
In additional, rename `registerViewClass(es)` to `registerDeserializer(s)`.
This moves us to a situation where any kind of object may want to be
deserialized, not just views.
2013-02-19 09:48:40 -07:00
Nathan Sobo
4c01a1e600 Fix spec to match improved CoffeeScript grammar 2013-02-18 18:10:43 -07:00
Nathan Sobo
d3c2623b61 Make deserializeView a global method
…along with `registerViewClass(es)`
2013-02-18 18:08:18 -07:00
Kevin Sawicki
4cfd2b41fb Destroy repo in an afterEach in Git specs 2013-02-15 09:56:04 -08:00
Kevin Sawicki
ee3f5a3c14 Remove unused repo variable 2013-02-15 09:56:04 -08:00
Kevin Sawicki
25e56b9967 Remove unneeded rootView variable in editor spec 2013-02-15 09:56:04 -08:00
Kevin Sawicki
ded53fd58c Add spec duration to mouseover summary 2013-02-15 09:56:04 -08:00
Kevin Sawicki
092e5214d0 Add spec for Git.getDiffStats(path) 2013-02-15 09:56:03 -08:00
Corey Johnson
56213872b2 Fix 💩 I shouldn't have checked in 2013-02-14 13:23:45 -08:00
Kevin Sawicki
58dbcc9ddc Un-f spec in atom-spec.coffee 2013-02-14 12:33:33 -08:00
Corey Johnson
da98addf80 better spec toggle 2013-02-14 12:31:31 -08:00
Corey Johnson & Nathan Sobo
da59459197 Autoscroll the last cursor when it inserts text
Normally, we don't autoscroll to a cursor when the buffer changes. But
this is a change caused by the cursor itself, so it makes sense to
keep it in view.
2013-02-14 13:21:39 -07:00
Corey Johnson & Nathan Sobo
52cbf5e367 Correctly translate clicks to screen positions w/ var-width fonts
Closes #267
2013-02-14 12:04:18 -07:00
Kevin Sawicki
1ab0db11bd Support folding multi-line comments 2013-02-14 10:57:39 -08:00
Kevin Sawicki
eb179af0d4 Merge pull request #271 from github/super-command-panel
Super command panel
2013-02-14 10:13:40 -08:00
Kevin Sawicki
43d46f0705 Load all .css files when theme has no package file
Closes #263
2013-02-14 09:04:32 -08:00
Kevin Sawicki
1922034df5 Disable jquery fx in specs 2013-02-13 17:13:15 -08:00
Corey Johnson
8375c8df38 Use previous package state when the wasn't activated 2013-02-13 16:37:59 -08:00
Corey Johnson
958bc2bfab Moved atom.loadPackage to a spec-only helper function 2013-02-13 16:37:59 -08:00
Corey Johnson
7ade089d04 If an atom package has no state, activate it with an empty object 2013-02-13 10:42:22 -08:00
Corey Johnson
52d4723711 Add underscore, camelize and dasherize to underscore 2013-02-13 10:42:22 -08:00
Corey Johnson
7ff0450379 Don't recurse into packageDirPaths to look for packagePaths 2013-02-13 10:42:22 -08:00
Kevin Sawicki & Nathan Sobo
b2a9208acf Tab no longer transfers focus
The tab keystroke is now suppressed in keymap
if no bindings are triggered.

Closes #258
2013-02-12 17:29:14 -08:00
Nathan Sobo
65bf13e211 Remove unneeded 'resize' event trigger. It's triggered by the helper. 2013-02-12 17:09:05 -07:00
Nathan Sobo
3625a55f68 Update markers before triggering 'changed' events
This prevents the editor from synchronously redrawing in specs with
cursors in invalid locations. Markers are always updated under the
hood before a change event is emitted from the Buffer or DisplayBuffer.
We still wait to trigger marker observers, but if their position gets
read, it is up to date.
2013-02-12 17:09:05 -07:00
Nathan Sobo
97988eb62e Clear font style in afterEach so it doesn't cause test pollution 2013-02-12 17:07:14 -07:00
Nathan Sobo
13db9169e9 Don't simulate DOM attachment. Pixel translation needs the real thing. 2013-02-12 17:07:14 -07:00
Nathan Sobo
405a918280 Never redraw when the font size changes on a detached editor
When the font size changes and the editor is detached, it schedules
itself to be redrawn the next time we're reattached rather than
updating the display in a detached state.

Detached display updates worked in the past because we didn't need to
be on the DOM to determine horizontal and vertical positions once we
had calculated dimensions once. So it worked to temporarily attach
the editor when calculating new dimensions, and then continue updates
even when it was detached. That now breaks because we can't ask for
pixel positions if we aren't on the DOM.
2013-02-12 17:07:14 -07:00
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
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
Kevin Sawicki
f65e83fe2a Add spec for converting CSON back to object 2013-02-04 09:08:00 -08:00
Kevin Sawicki
ffc65b3735 Add more CSON specs 2013-02-04 09:08:00 -08:00
Jon Rohan
3cf07d29f3 Changing the if-focused event binding to blur. 2013-02-03 09:01:27 -08:00
Nathan Sobo
bd96db781e Pass old/new buffer and screen positions to marker position observers
This is needed by the snippets package, which needs to know where the
cursor was previously when it moves to decide whether to cancel the
current snippet.
2013-02-02 18:00:35 -07:00
Nathan Sobo
e25d83ccbc Use new addEqualityTester method to employ _.isEqual in specs 2013-02-02 17:58:39 -07:00
Nathan Sobo
d144dd4efe Merge branch 'dev' into better-anchors 2013-02-02 17:03:57 -07:00
Nathan Sobo
94f1630152 Bind window focus and focusout events separately to fix spec 2013-02-02 17:02:07 -07:00
Nathan Sobo
7867d0cb3b Fix spec for 'focused' to 'is-focused' class rename. 2013-02-02 16:55:51 -07:00
Nathan Sobo
abafb541df Merge remote-tracking branch 'origin/dev' into better-anchors 2013-02-02 16:47:09 -07:00
Nathan Sobo
aa076a0bf2 Remove focused specs 2013-02-02 16:45:15 -07:00
Nathan Sobo
80b39ae263 Replace mentions of 'anchor' with 'tail' in selection and its spec 2013-02-02 16:44:13 -07:00
Nathan Sobo
6beee10160 Replace anchor w/ marker in selection destruction spec 2013-02-02 16:41:57 -07:00
Nathan Sobo
12425b796c Tweak specs now that buffer changes don't autoscroll the cursor 2013-02-02 16:34:28 -07:00
Nathan Sobo
e53403718a Tell marker head observers if a move was caused by a buffer change
This is used by cursor to only autoscroll when the marker head is
explicitly moved, so that passive movements caused by buffer insertions
don't trigger autoscrolling.
2013-02-02 16:17:14 -07:00
Nathan Sobo
c865b9f53a Update selection autoscroll specs with 3-valued logic
If autoscroll is true, we center the view on the selection. If false,
we do no autoscrolling at all. And if undefined we autoscroll to the
cursor.
2013-02-02 15:58:35 -07:00
Nathan Sobo
3d8406f5a3 Clip screen positions before translating to buffer positions 2013-02-02 15:07:17 -07:00
Jon Rohan
fa940d0386 Merge pull request #168 from github/window-focused
Atom Window Focused
2013-02-01 17:50:28 -08:00
Jon Rohan
0d2a328dcc making the editor .focused .is-focused for symmetry 2013-02-01 19:23:52 -05:00
Kevin Sawicki
69097bee50 Kill trailing newline and inline empty arrays 2013-02-01 16:20:25 -08:00
Kevin Sawicki
83b6a93684 Add initial CSON pretty printer 2013-02-01 16:15:54 -08:00
Jon Rohan
e54c3d8fbb adding is-focused to body, and styling light ui 2013-02-01 18:40:53 -05:00
Jon Rohan
f62e49d2f4 Adding back the font-weight font-style to tmThemes
We can add this back now because in the default tests we're using a true
monospaced font, not the fake monospace font Inconsolata.
2013-02-01 11:09:12 -05:00
Nathan Sobo
1bbb954239 EditSession specs passing after converting Selection to use markers
Still a bit of a mess though...
2013-01-31 18:26:29 -07:00
Corey Johnson
8e0b6aec40 Longer spec timeout 2013-01-31 15:46:54 -08:00
Corey Johnson
5d95d8bc4e Remove log noise while running tests 2013-01-31 15:16:03 -08:00
Nathan Sobo
628701fd3a Finish converting cursors to use markers.
The model layer works at least… haven't tested the view. Will test out
the view once I get the selection model working.
2013-01-31 15:52:28 -07:00
Nathan Sobo
ec521b3fd3 Add ability to cancel marker head position observations 2013-01-31 14:11:28 -07:00
Nathan Sobo
bc44540b10 Start adding ability to observe marker head positions 2013-01-31 14:00:01 -07:00
Kevin Sawicki
379a4a4d8d Only auto-load .cson and .json keymap files
This now prevents files such as .DS_Store from being loaded as a
keymap where previously all paths were loaded regardless of extension.

Closes #205
2013-01-31 12:03:21 -08:00
Corey Johnson & Kevin Sawicki
8f030cd97e Always calculate dimensions with editor on DOM
Closes #206
2013-01-31 10:31:13 -08:00
Jon Rohan
11c0637220 Not adding a font family when the user doesn't have it set 2013-01-31 10:19:41 -05:00
Nathan Sobo
074c1815d0 Start adding marker methods to DisplayBuffer
Whereas marker methods on buffer take for granted that everything is
in buffer coordinates, methods on the DisplayBuffer offer both
screen and buffer coordinate versions of the marker API.
2013-01-30 22:46:52 -07:00
Nathan Sobo
1d1c613f5b Allow buffer marker head and tail positions to be manipulated 2013-01-30 22:16:08 -07:00
Nathan Sobo
5dd142b966 Allow markers to be created in a reverse orientation
This means that the head of the marker precedes its tail in the buffer.
This will be important if we want to build selections on top of markers.
2013-01-30 21:44:57 -07:00
Nathan Sobo
d8ffdcd6bd Allow markers to be created with just a position
When a marker is created with just a position, it only gets a head
position and has no tail position.
2013-01-30 21:37:57 -07:00
Nathan Sobo
0e67f35748 Start on marker interface in DisplayBuffer 2013-01-30 21:04:52 -07:00
Nathan Sobo
fd99c795b9 Merge remote-tracking branch 'origin/dev' into better-anchors 2013-01-30 20:45:31 -07:00
Nathan Sobo
e02f9cd830 Rename Buffer.createMarker to markRange 2013-01-30 17:41:04 -07:00
Nathan Sobo
dfe0cad217 Replace anchor point/range with a single concept: markers
A "marker" is basically like a persistent selection/cursor composite,
having a head and a tail. The "head" is like the cursor in a selection,
and the "tail" is like the part of the selection that doesn't move. My
goal is for markers to be the only construct used to track regions
in the buffer. I want to replace anchors with them.
2013-01-30 16:52:09 -07:00
Kevin Sawicki
1acf0b870f Support translating points and ranges 2013-01-30 13:49:10 -08:00
Corey Johnson
c650deea01 Merge branch 'font-config' into dev 2013-01-30 13:24:12 -08:00
Nathan Sobo
bcd9d5d2b9 Rename addAnchorPoint to createAnchorPoint 2013-01-30 13:57:39 -07:00
Nathan Sobo
063cb71175 Spelling 💄 in spec 2013-01-30 13:24:15 -07:00
Corey Johnson
9b1cb29e1f Don't store fontSize and fontFamily as instance variables 2013-01-30 12:20:02 -08:00
Corey Johnson
29ccd271de Set font-size css property using style tag 2013-01-30 12:11:17 -08:00
Corey Johnson
9ea29b2899 Set font-family css property using style tag 2013-01-30 12:07:23 -08:00
Nathan Sobo
113a8fa279 Merge remote-tracking branch 'origin/dev' into better-anchors
Conflicts:
	src/app/cursor.coffee
	src/app/editor.coffee
2013-01-30 12:59:04 -07:00
Kevin Sawicki
f90d29262c Use octicon as folding indicator 2013-01-30 11:50:29 -08:00
Kevin Sawicki
8dbcefa932 Style color of folded line numbers 2013-01-30 11:50:23 -08:00
Nathan Sobo
ec3a1a80cd Restore invalidated anchor points on undo/redo of a change 2013-01-30 12:48:29 -07:00
Nathan Sobo
30909a8e8f Move anchor points to buffer; restore invalidated points on undo 2013-01-30 12:23:42 -07:00
Corey Johnson
e7c3282f53 Add font-family spec 2013-01-30 10:15:34 -08:00
Corey Johnson & Kevin Sawicki
4db876aed1 Deleting before fold no longer unfolds after undo
Use same row delta computation for updating start and
end rows in folds.
2013-01-30 09:10:26 -08:00
Corey Johnson
97fa9d522a end/beginning word implementations are now more similar 2013-01-30 08:39:32 -08:00
Nathan Sobo
6c7b93872c Add failing specs for undoing changes that surround anchor points 2013-01-29 18:29:42 -07:00
Nathan Sobo
0ecfba3262 WIP: Start adding new anchorPoint API on edit session
These will replace anchors, but they won't be stored on the Buffer
at all. The API user will access them by a returned scalar id rather
than calling methods on the returned anchor object directly.
2013-01-29 18:21:56 -07:00
Corey Johnson
46aefc75ab Make EditSession specs match vim style word behavior 2013-01-29 16:57:23 -08:00
Corey Johnson
dac92ca6e7 Make cursor.moveCursorToBeginningOfWord behave like vim 2013-01-29 16:57:22 -08:00
Corey Johnson
b66efbe3e7 cursor.getBeginningOfCurrentWordBufferPosition behaves like vim 2013-01-29 16:57:22 -08:00
Kevin Sawicki
1303e58a87 Don't move trailing newline for multiline selections 2013-01-29 16:51:33 -08:00
Kevin Sawicki
1a04fa31d1 Clip range specified to Buffer.getTextInRange() 2013-01-29 15:35:14 -08:00
Nathan Sobo
3f50dbe1f8 💄 2013-01-29 16:00:45 -07:00
Kevin Sawicki
096566ab2a Bind ctrl-meta-down to move line(s) down
Refs #134
2013-01-29 14:58:52 -08:00
Kevin Sawicki
ad7e4b63c0 Bind ctrl-meta-up to move line(s) up
Refs #134
2013-01-29 14:58:51 -08:00
Nathan Sobo
2380fa3445 Handle 'autoscroll' entirely in Cursor instead of in Anchor
This commit makes autoscroll a 3-valued property on the cursor. If it
is set to true or false, that setting will stick until the cursor's
next visual update. That means we can explicitly move the cursor with
autoscroll set to false, but also still autoscroll by default when the
cursor's anchor moves on its own.
2013-01-29 12:11:43 -07:00
Kevin Sawicki
e792265076 Trigger grammars-loaded event on syntax 2013-01-28 14:34:49 -08:00
Kevin Sawicki
ad8dd767e5 Don't allow web worker grammars to be registered
Grammars are already loaded at the beginning of the
specs synchronously and should not be overridden
when testing the background load task.
2013-01-28 14:23:18 -08:00