Commit Graph

2768 Commits

Author SHA1 Message Date
Kevin Sawicki & Nathan Sobo
5a26fa838f Emit markers-updated event for remote buffer changes
This is temporary until markers are a part of telepath.
2013-07-05 12:53:51 -07:00
Kevin Sawicki & Nathan Sobo
e82170efcb Serialize EditSession's buffer's id instead of its path 2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
9b22ca4825 Serialize window state in telepath format 2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
85cc81851f Replicate insertion and removal of project buffers
Buffers are now destroyed when removed from the project if they
haven't been destroyed already.
2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
30273c6a66 Add serialization version to TextBuffer 2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
e01ac96b66 Guard against a null pending changed event
Previously TextBuffer would emit change events even when the change
was empty. SharedString does not emit empty change events and so a
pending event may no longer be present when a marker-updated event
fires.
2013-07-05 12:53:50 -07:00
Kevin Sawicki
f766bbbb38 Remove Point and Range classes now provided by telepath 2013-07-05 12:53:50 -07:00
Kevin Sawicki
fddcbae4eb Clip range specified to change() 2013-07-05 12:53:50 -07:00
Kevin Sawicki
2d313e07ff Clip position in characterIndexForPosition() 2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
05a3f35512 Normalize line endings in TextBuffer.change() 2013-07-05 12:53:50 -07:00
Kevin Sawicki & Nathan Sobo
72f9af4d00 Replicate buffer changes
Still some failures due to line endings
2013-07-05 12:53:49 -07:00
Kevin Sawicki & Nathan Sobo
dd0f7a032f Start basing Buffer's text on a replicable string 2013-07-05 12:53:49 -07:00
Kevin Sawicki & Nathan Sobo
010c3435da Add Project serialization version 2013-07-05 12:53:49 -07:00
Kevin Sawicki & Nathan Sobo
da3a89fc27 Don't show pane items that can't be deserialized 2013-07-05 12:53:49 -07:00
Nathan Sobo
30e4531a8f Store buffer paths instead of serialized buffers in EditSession state
Since there can be multiple edit sessions per buffer, it doesn't make
sense to serialize the buffer multiple times. Previously, we were
de-duplicating buffers in the deserialize method itself, but this won't
work now that we want to replicate buffers.
2013-07-05 12:53:49 -07:00
Kevin Sawicki
651bbaa3ce Create an empty ~/.atom/config.cson when missing
Closes #614
2013-07-05 09:17:44 -07:00
Kevin Sawicki
c7f6e87132 Only use event.which when key identifier is non-ASCII
Previously event.which was used when it was less than the key identifier
which broke fn-delete since that generates a valid key identifier but a
lower event.which value that does not translate to 'delete' using the char
code converter.

Close #611
2013-07-02 13:13:45 -07:00
Kevin Sawicki & Nathan Sobo
0e6a3c52ad Add comments to view cache ivars 2013-07-02 10:13:59 -07:00
Kevin Sawicki
b786bcc774 Store views that don't implement setModel() by their item
Previously viewForItem() would create a new view each time it was called
with an item whose view did not implement setModel() even if a view for that
item already existed in the pane.

Now a WeakMap is used to map items to their view so they can be reused
and cleaned up even when the view does not implement setModel().
2013-07-02 09:41:46 -07:00
Nathan Sobo
23df564189 Release any leftover buffers in Project.destroy 2013-07-01 14:21:42 -06:00
Nathan Sobo
0c17ed9c33 Return a clone of @buffers from Project.getBuffers
Previously, we traversed the EditSessions. Not necessary.
2013-07-01 14:21:42 -06:00
Kevin Sawicki & Nathan Sobo
268edf16d8 Make setModel optional in pane item view classes 2013-07-01 10:53:34 -07:00
Kevin Sawicki
01f220fb1b Support non-English keyboard languages
Use event.which if it is lower than the parsed key identifier.
This is the case when a non-English keyboard language is selected and
a physical English keyboard is being used.

This allows keybindings to still work even when the physical key pressed
is different than the key it maps to for the currently selected language.

Closes #585
2013-06-28 16:36:55 -07:00
Kevin Sawicki
53a92751e6 Add missing @ before call to confirmSync 2013-06-28 10:06:41 -07:00
Nathan Sobo
5a9e45f9d8 Upgrade telepath 2013-06-28 04:39:31 -06:00
Kevin Sawicki
8561bb34a8 Save and restore spec window dimensions
Closes #597
2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
f4300b8cab Fix specs due to scrollTop/Left becoming methods on EditSession 2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
f3f9c2c921 Show active item from Pane constructor if state has activeItemUri 2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
33dca9315c Add PaneContainer.getState 2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
c596514d11 Accept documents in EditSession and replicate scroll position 2013-06-28 04:39:30 -06:00
Kevin Sawicki & Nathan Sobo
5b00cf1701 Rename Buffer -> TextBuffer to match file and deserializer name 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
a62cd0f16a Replicate active pane item 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
f340828506 Use .getState() instead of .serialize() when mutating panes 2013-06-28 04:39:29 -06:00
Kevin Sawicki & Nathan Sobo
cd4622fbeb Serialize project in window state 2013-06-28 04:39:27 -06:00
Kevin Sawicki & Nathan Sobo
b5b408d134 Open new window when joining collaboration session 2013-06-28 04:39:27 -06:00
Kevin Sawicki
31d872fbfe Add atom.openWindow() 2013-06-28 04:39:26 -06:00
Kevin Sawicki & Nathan Sobo
0851b4d011 Replicate pane splitting and removal
We're using Peer.js to stream changes to shared telepath documents
between participants.

We're replacing the rootView of joiners in a somewhat hacky way,
but replication of pane splits and items is fully tested.
2013-06-28 04:39:26 -06:00
Kevin Sawicki & Nathan Sobo
6480e956af Keep resident window state object 2013-06-28 04:39:26 -06:00
Kevin Sawicki & Nathan Sobo
9c95a4751b Return telepath documents from getWindowState() 2013-06-28 04:39:25 -06:00
Cheng Zhao
e434f7c0a9 💄 2013-06-27 22:39:41 +08:00
Cheng Zhao
e7aac2ef6e Show confirm close dialog as sheet. 2013-06-27 21:30:47 +08:00
Cheng Zhao
45ce8e1d63 Ask for close confirmation in beforeunload handler. 2013-06-27 18:39:29 +08:00
Cheng Zhao
bdbec54f24 Make PaneContainer.confirmClose() synchronous. 2013-06-27 16:21:14 +08:00
Cheng Zhao
6c0f4c09d9 Make Pane.promptToSaveItem synchronous. 2013-06-27 12:40:36 +08:00
Kevin Sawicki
e67676b01c Use deleteSelectedText() instead of delete()
Selection.delete() adds to the selection if it is empty which
we don't want to do when replacing selected text.

Closes #603
2013-06-26 19:03:45 -07:00
Kevin Sawicki
f3b50eed3b Migrate close bindings from editor namespace to pane
These were left over from the pane migration still under
the editor namespace and were previously not accessible via
a keybinding.
2013-06-25 13:15:39 -07:00
Kevin Sawicki
86c8343107 Score grammar matches using longest fileType match
Previously the score for two grammars matching on path
was equal and so the first one would be selected.

Now the longer match will have a higher score and will be selected
over other grammars with shorter fileType match lengths.

Closes #602
2013-06-24 18:23:54 -07:00
Kevin Sawicki
a7ee5985db Separate variable from requires 2013-06-24 16:56:52 -07:00
Kevin Sawicki
be354f78a6 Focus root view if previously focused element is no longer attached
This can be the case when a select list is triggered while a different
select list is already open and so the second list to open has no
element to restore focus to when it closes.
2013-06-24 16:46:36 -07:00
Kevin Sawicki
d6513e9aa9 Use BufferedProcess for apm commands
This ensures the path to node is always available in the environment.
2013-06-24 16:44:40 -07:00