Corey Johnson & Nathan Sobo
6177b46cf9
Restore selection on active edit session when undoing/redoing
...
The `do`, `undo`, and `redo` methods on operations take an optional editSession argument, which can be used to determine the context in which they are being run. We restore selections on that edit session instead of the session where the operations originally occurred.
2012-07-06 11:42:07 -06:00
Nathan Sobo
53d6c4960a
Fix specs that broke due to no subscription on Buffer
from UndoManager
2012-07-05 20:06:09 -06:00
Nathan Sobo
42eefb49a9
Add UndoManager.prototype.transact
...
The `transact` method takes a function and batches all operations within that function as a single transaction to be undone and redone. The edit session now uses generic operations to restore selection state around transactions. The `undo` and `do` methods on operations are now optional. In addition, the undo manager now supports an optional `redo` method on an operation for code that should *only* be run on redo, and not when the operation is initially pushed. This is used by edit session to restore selection state after redo.
2012-07-05 20:04:16 -06:00
David Graham & Nathan Sobo
6fbd019b1d
Pull out a BufferChangeOperation, which Buffer.change sends to UndoManager
2012-07-05 19:07:12 -06:00
Nathan Sobo
569359b687
Don't destroy selection/cursor anchors when encompassed by a change
...
Add the 'strong' option to anchors. If anchors are 'strong' instead of being destroyed by encompassing changes they move to the beginning of the change range.
2012-07-05 15:20:28 -06:00
Nathan Sobo
60a4f23c50
Anchors are destroyed when encompassed by a buffer change
2012-07-05 14:53:37 -06:00
Nathan Sobo
f253820250
💄 Use more delegated (editor -> buffer) methods
2012-07-04 12:58:00 -06:00
Nathan Sobo
b254fa39d9
💄 Replace editor.getBuffer().getText() w/ editor.getText()
2012-07-04 12:41:51 -06:00
Nathan Sobo
6d7a6f9a92
💄 Replace editor.getBuffer().getPath() w/ editor.getPath()
2012-07-04 12:40:17 -06:00
Nathan Sobo
c90c2e80d6
Replace @buffer reference on Editor with @getBuffer method
2012-07-04 12:34:44 -06:00
Nathan Sobo
fb6aa46531
Editor subscribes to buffer-path-change events on edit sessions, not buffers directly
2012-07-04 12:05:09 -06:00
Nathan Sobo
bdfdf08ea0
Adjust Editor.scrollTop when removing a line reduces the scroll height
...
This eliminates rendering artifacts and jerky scrolling at the bottom of the screen
2012-07-03 11:12:54 -06:00
Nathan Sobo
3ee7c0dc0f
"Scroll" gutter by relatively positioning its line numbers
...
This matches how we scroll lines, and eliminates opportunities for the gutter to get out of sync with the lines. If that happened, it would probably be a bug, but this at least eliminates one source of confusion when debugging.
2012-07-03 11:09:34 -06:00
Nathan Sobo
9cae4d3d8f
Rename RootView.editors -> getEditors
2012-07-02 19:47:38 -06:00
Nathan Sobo
bd5c1f8694
Rename RootView.activeEditor -> getActiveEditor
2012-07-02 19:46:33 -06:00
Nathan Sobo
a38042f89f
Rename Editor.removeActiveEditSession -> destroyActiveEditSession
2012-07-02 19:44:24 -06:00
Corey Johnson & Nathan Sobo
b59bd4bc7b
Saving a buffer does not trigger a "contents-change" event
2012-07-02 17:48:30 -07:00
Nathan Sobo
7387ad13f6
Merge branch 'master' of https://github.com/github/atom
2012-07-02 13:13:51 -06:00
Nathan Sobo
6b3180e144
Ensure path is present before building a Buffer with it in spec
2012-07-02 13:13:25 -06:00
Corey Johnson
10bfc56624
When a Buffer is created, the initial call to setText is not treated as an undoable change.
2012-07-02 11:39:22 -07:00
Corey Johnson
ae34611d2a
Changes to buffer (via external process) do set buffer as modified.
2012-07-02 09:13:05 -07:00
Corey Johnson
801a91ec9b
Specs cleanup buffers
2012-06-29 15:38:12 -07:00
Corey Johnson
c3d7d3566f
Buffer listens for changes to file and triggers 'contents-change' event
2012-06-29 15:09:31 -07:00
Corey Johnson
e295d19d51
Editor.prototype.removeActiveEditSession
calls destroy
on the removed edit session
2012-06-29 15:09:01 -07:00
Corey Johnson
3dd9253bc5
When Buffer's path changes, stop listening for events on former path
2012-06-29 15:09:01 -07:00
Corey Johnson
8e7a8836cd
Unmodified buffer updates contents when file changes outside of atom.
2012-06-29 15:09:01 -07:00
Corey Johnson
6182cf4736
un-f and un-console
2012-06-29 15:09:01 -07:00
Corey Johnson
e24c9932a4
Files trigger contents-change event
2012-06-29 15:09:01 -07:00
Nathan Sobo
3524490946
Ensure selection emits event if a buffer change moves its anchor
2012-06-29 11:55:16 -06:00
Nathan Sobo
6c60993f5c
Fuzzy buffer finder switches to the editor that has the selected buffer if it isn't open on the current active editor
2012-06-29 09:59:37 -06:00
Nathan Sobo
22515e7ba0
RootView.open takes an 'allowActiveEditorChange' option
...
When the 'allowActiveEditorChange' option is true, RootView will try to activate an existing edit session for the given path on *any* editor, and switch focus there. This will be used by the fuzzy-finder for the meta-b option, which should open the chosen buffer on the editor that contains it, even if it isn't currently active.
2012-06-29 09:48:16 -06:00
Nathan Sobo
423b312e9c
Meta-b opens the fuzzy finder with paths to the current editor's buffers
2012-06-28 12:57:52 -06:00
Nathan Sobo
5b11762989
Fix bug where edit sessions were not properly restored on refresh
2012-06-27 07:53:32 -06:00
Nathan Sobo
086b33f606
Merge branch 'snippets'
...
Conflicts:
src/app/root-view.coffee
2012-06-26 22:58:32 -06:00
Corey Johnson
6d69ec77f1
Remove un-needed window.advanceClock calls from editor
2012-06-26 16:41:13 -07:00
Nathan Sobo
6389b19b7c
Merge branch 'master' into snippets
2012-06-22 16:25:33 -06:00
Nathan Sobo
e2efa95d13
Ensure that 'change-screen-range' events are triggered on selections by backspace
2012-06-22 16:20:50 -06:00
Nathan Sobo
e1309f7c66
Key binding event handlers can call abortKeyBinding on the event object to abort and try the next binding
2012-06-20 22:08:16 -06:00
Nathan Sobo
d50b7f7a37
Trigger a 'new-edit-session' event when Project.prototype.open creates an EditSession
2012-06-20 17:40:45 -06:00
Nathan Sobo
e3d7ab31b5
Merge branch 'project-refactor'
2012-06-20 16:41:54 -06:00
Nathan Sobo
b4d77fd107
Load user configuration as part of RootView initialization, before any editors are created
2012-06-20 16:06:45 -06:00
Corey Johnson & Nathan Sobo
af9aec7cbc
SoftWrap state is stored in EditSessions, but it is set and toggled via Editor.
2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
d1c1f3cfce
Move autoIndent, tabText, softTabs and softWrap to project
2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
4e78b29e81
Replace Editor.setBuffer with Editor.edit
2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
1280370fd1
Editor constructor requires an editSession (unless it is a mini buffer)
2012-06-20 09:28:23 -07:00
Corey Johnson & Nathan Sobo
4659fd7dc3
Project.open returns an editSession instead of a buffer.
...
First step in removing the coupling of Editor and Buffer. Editor should get all information about the active buffer from the activeEditSession.
2012-06-20 09:28:22 -07:00
Nathan Sobo
c21766c328
Add RootView.proto.focusNextPane
2012-06-18 20:27:39 -06:00
Nathan Sobo
171a19369a
Fix remaining multi-keystroke specs
2012-06-18 17:31:26 -06:00
Nathan Sobo
85f695e4f1
Ensure that only whole keystrokes are matched in binding prefix matches
2012-06-18 17:31:11 -06:00
Nathan Sobo
5ef5c4565a
Merge branch 'master' of github.com:github/atom into multi-keystroke-bindings
2012-06-18 17:06:17 -06:00