Commit Graph

1694 Commits

Author SHA1 Message Date
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
7ade089d04 If an atom package has no state, activate it with an empty object 2013-02-13 10:42:22 -08:00
Corey Johnson
e1219b9fcf Create package-generator package 2013-02-13 10:42:22 -08:00
Corey Johnson
d049f47844 expose config.userPackagesDirPath 2013-02-13 10:42:22 -08:00
Nathan Sobo
461051f756 Simplify select list keymap selector
I used it as an example in the docs, so I wanted it to be simple. I
tried this version and it still worked.
2013-02-13 11:34:45 -07:00
Kevin Sawicki
449e4f5ac7 Load user keymaps after packages
This allows user keymaps to override the default
bindings provided by packages.

Refs #261
2013-02-12 20:38:05 -08:00
Kevin Sawicki
8395b47c4e 💄 2013-02-12 19:08:30 -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
e7fb13037a 💄 2013-02-12 17:09:06 -07:00
Nathan Sobo
3ab354d426 Recycle existing lines when calculating pixel positions 2013-02-12 17:09:06 -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
2d2b4ea754 Redraw on reattached only if detached editor was previously attached 2013-02-12 17:09:05 -07:00
Nathan Sobo
498c11a080 Don't translate screen to pixel positions if Editor isn't on the DOM 2013-02-12 17:07:14 -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
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
37ff0d05ed Subscribe to grammars-loaded event in editor
Previously an error would be logged if this event fired
after an editor had been removed.
2013-02-12 15:12:59 -08:00
Justin Palmer
658b243a16 Merge pull request #257 from github/gfm-styles
Simple styles for GFM
2013-02-12 13:59:01 -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
9af54de0f6 Add type of invisible as second class in span
This allows hard tabs, leading whitespace, and
trailing whitespace to be styled independently.
2013-02-12 13:02:34 -08:00
Justin Palmer
cc9707bd35 add markdown.css 2013-02-12 12:00:54 -08:00
Kevin Sawicki
0b2e2dad71 Merge pull request #135 from github/undo-tab-close
Restore last closed tab
2013-02-12 11:22:46 -08:00
Kevin Sawicki
d234c8fdce Don't track closed sessions with no path 2013-02-12 11:20:21 -08:00
Kevin Sawicki
9e39a382e8 DRY up checking if path is .cson or .json 2013-02-12 11:02:07 -08:00
Kevin Sawicki
5944c351ec Suppport .json grammars 2013-02-12 09:48:25 -08:00
Kevin Sawicki
5ecbda0aac Restore closed tab at previous index 2013-02-12 09:41:32 -08:00
Kevin Sawicki
fb9451556d Bind to body instead of #root-view 2013-02-12 09:00:07 -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
c9fae85375 Rename moveEditSessionAtIndex to moveEditSessionToIndex 2013-02-11 20:29:48 -08:00
Kevin Sawicki
472b436b24 Add spec for dragging/dropping tabs across editors 2013-02-11 20:24:01 -08:00
Kevin Sawicki
8b61c0d8f7 Rearrange tabs when the edit session order changes 2013-02-11 19:40:33 -08:00
Kevin Sawicki
a104e67acd Support moving an edit session's editor index 2013-02-11 18:36:50 -08:00
Justin Palmer
0acd532428 Add transferEditSessionAtIndex to Editor 2013-02-11 17:02:34 -08:00
Justin Palmer
ae841c2bf7 pass event to shouldAllow* methods 2013-02-11 08:17:32 -08:00
Kevin Sawicki
12b185af79 Use fs.extension instead of regex 2013-02-10 15:13:00 -08:00
Kevin Sawicki
de6e930bad Support package.cson in Atom themes
Migrate light and dark themes to use package.cson
instead of package.json
2013-02-10 15:11:06 -08:00
Justin Palmer
9c99369c10 add methods to determine if we should allow dragging and dropping 2013-02-10 10:46:02 -08:00
Justin Palmer
b2ce4ca6d5 merge dev, fix conflicts from package rewrite 2013-02-09 20:17:29 -08:00
Justin Palmer
a1a663cd30 implement indexOfPane in RootView to get array index
We need something like this because jquery's el.index() doesn't work
when multiple panes are spread out among different rows and columns.
2013-02-09 19:38:55 -08:00
Justin Palmer
c7c9656c46 remove drop dom manipulation from sortable-list
Not sure how we should handle generic drag and drop.  Tabs are more
complex because of multiple panels
2013-02-09 19:38:55 -08:00
Justin Palmer
be49f047e1 index -> sortable-index 2013-02-09 19:38:55 -08:00
Justin Palmer
b00df1aae0 sortableElement -> getSortableElement 2013-02-09 19:38:55 -08:00
Justin Palmer
8a50581430 rename sortable view to sortable list 2013-02-09 19:38:54 -08:00
Justin Palmer
9100367c12 very basic tab sorting 2013-02-09 19:38:54 -08:00
Nathan Sobo
d8111797ba 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-09 19:38:54 -08:00