Commit Graph

1125 Commits

Author SHA1 Message Date
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
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
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
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
43d46f0705 Load all .css files when theme has no package file
Closes #263
2013-02-14 09:04:32 -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
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
07c5a94613 Remove unused packages ivar 2013-02-12 15:47:31 -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
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
Kevin Sawicki
a104e67acd Support moving an edit session's editor index 2013-02-11 18:36:50 -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
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