Commit Graph

1757 Commits

Author SHA1 Message Date
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
d3c2623b61 Make deserializeView a global method
…along with `registerViewClass(es)`
2013-02-18 18:08:18 -07:00
Kevin Sawicki
2910f7798a Always use global rootView object
This removes the last few places where rootView was
looked up via jQuery selector and instead just uses
the rootView property available on the window.
2013-02-15 09:56:03 -08:00
Kevin Sawicki
f730672e9d Use ? instead of or 2013-02-15 09:56:03 -08:00
Nathan Sobo
69da0bb2aa Add alt-meta-left and alt-meta-right bindings for tab switching
These are common bindings for switching tabs. Before we used them to
split views, but this is a more expected behavior.
2013-02-15 10:39:15 -07:00
Nathan Sobo
a300337557 Change split-view bindings to avoid confusion w/ tab-switching
Now you can use the vim-style `ctrl-w *` bindings, or use `ctrl-|` and
`ctrl--`, which resemble horizontal and vertical splits as characters.
2013-02-15 10:39:15 -07:00
Corey Johnson
e7a8e4e3c4 Add atom.update and atom.getUpdateStatus 2013-02-14 16:40:24 -08:00
Nathan Sobo
2f71ee9a0d Prevent clicks on a focused editor from unfocusing its hidden input
This closes #233. When an editor is focused, what's *actually* focused
is a hidden input element inside the editor. So clicking on a focused
editor was temporarily stealing focus away from the hidden input, and
then moving it back to the hidden input (which the editor always does
when it is focused). Returning false from the mousedown handler when
the editor is already focused prevents this bouncing of focus and
prevents the fuzzy finder from hiding when you click its editor.
2013-02-14 13:38:46 -07:00
Kevin Sawicki
15c02014f7 💄 2013-02-14 12:27:46 -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
Kevin Sawicki
1fed183a8c Perform whitespace check after scopes check 2013-02-14 11:48:03 -08:00
Kevin Sawicki
e0556d85af Advance over tokens that are only whitespace 2013-02-14 11:47:07 -08: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
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