Nathan Sobo
1ac6581f33
EditSession.setSelectedBufferRanges recycles selection instances
...
This prevents changing the scroll position when it isn't necessary.
2012-07-15 17:32:30 -06:00
Nathan Sobo
075968e42c
Associate compiled operations with anchor ranges. All tests pass again.
...
This allows them to update their target range in the face of upstream changes.
2012-07-13 19:46:08 -06:00
Corey Johnson & Nathan Sobo
fd24b82d47
WIP: Converting to operations, but substitution operations need anchor ranges
2012-07-13 18:30:10 -06:00
Corey Johnson & Nathan Sobo
926067164d
Buffer updates anchors when it changes instead of EditSession
2012-07-13 17:42:41 -06:00
Corey Johnson & Nathan Sobo
9eae88e97b
Anchors and AnchorRanges are added to the buffer.
...
Also: Destroying an AnchorRange removes it from the EditSession / Buffer.
2012-07-13 17:18:10 -06:00
Corey Johnson & Nathan Sobo
c7b7135388
Temporary fix: When editor is resized, adjust width of rendered lines.
...
We do this to ensure that the lines aren't longer than the scroll view if they don't have to be. We really should use min-width instead because it's automatic. Also, trigger window resize when we make the editor narrower.
2012-07-13 17:17:18 -06:00
Corey Johnson & Nathan Sobo
e15f2204c7
Merge branch 'global-find' of github.com:github/atom into global-find
2012-07-13 15:12:41 -06:00
Corey Johnson & Nathan Sobo
42f322a112
CommandInterpreter uses project and edit sessions instead of editor to execute
...
We don't want to pass view objects into it!
2012-07-13 15:10:37 -06:00
Corey Johnson
b9d4270693
Merge branch 'master' into global-find
2012-07-13 09:36:21 -07:00
Corey Johnson
23b42faa1d
Added EditSession.copy()
...
Also, EditSession only needs a project to be deserialized
2012-07-13 09:35:19 -07:00
Corey Johnson
9dfa7d9439
When splitting an editor only the active edit session is copied to the new editor.
2012-07-13 09:24:14 -07:00
Corey Johnson & Nathan Sobo
d44c648d4b
Editor.renderedLines' width is set to the maximum of either Editor.scrollView's width or the maximum rendered line width
2012-07-13 09:05:38 -07:00
Nathan Sobo
a4db677979
Implement setSelectedBufferRange w/ setSelectedBufferRanges
...
Also add the preserveFolds option, which doesn't destroy folds containing the selected ranges – mainly for specs right now
2012-07-12 18:57:12 -06:00
Nathan Sobo
f99146b42f
EditSession.setSelectedBufferRanges destroys folds
...
It also clears all existing selections and makes new ones.
2012-07-12 18:40:34 -06:00
Corey Johnson & Nathan Sobo
64a9c245e7
Quote regex passed to grep
2012-07-12 12:11:00 -07:00
Corey Johnson & Nathan Sobo
d2d6efdcb5
Project.scan invokes the callback with matches
2012-07-12 11:12:31 -06:00
Nathan Sobo
3854f73c84
WIP: Start on Project.prototype.scan
...
Right now it calls out to grep and parses the output, but doesn't do anything with it just yet.
2012-07-11 18:50:38 -06:00
Nathan Sobo
61cfbe530b
Fix indentation of selected region with tab
2012-07-06 15:18:32 -06:00
Corey Johnson & Nathan Sobo
fca74ee925
Revert "WIP: making folded lines look better"
...
This reverts commit 0e4f156cb0 .
2012-07-06 12:36:50 -07:00
Corey Johnson
5281a47023
Merge pull request #30 from github/improve-undo-manager
...
Improve undo manager
2012-07-06 12:23:55 -07:00
Corey Johnson
0e4f156cb0
WIP: making folded lines look better
2012-07-06 11:19:19 -07:00
Corey Johnson & Nathan Sobo
9f9c636883
When snippet expansion is undone, the snippet is destroyed
...
This is still in progress. You can't *redo* snippet expansion and restore tab stops. Also, this commit performs all changes associated with snippet expansion in a transaction.
2012-07-06 12:10:14 -06:00
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
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
c053be3394
Rename UndoManager.perform -> pushOperation
...
I'm about to expand the types of operations so that some don't always have a `do` method. Therefore `perform` is a misnomer.
2012-07-05 19:46:08 -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
David Graham & Nathan Sobo
78f88a5c5c
Begin extracting BufferChangeOperation from UndoManager
2012-07-05 17:18:55 -06:00
David Graham & Nathan Sobo
822b85a8be
Make @probablycorey happier
2012-07-05 17:18:11 -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
0043a5045b
Refactor snippets extension
...
Pull out a SnippetExpansion class that is created when a snippet is successfully expanded. This is the only object that gets associated with the edit session.
2012-07-04 21:59:05 -06:00
Nathan Sobo
2ddd5820f7
💄 Rename lastLine -> getLastLine
2012-07-04 12:59:54 -06:00
Nathan Sobo
f253820250
💄 Use more delegated (editor -> buffer) methods
2012-07-04 12:58:00 -06:00
Nathan Sobo
6d7a6f9a92
💄 Replace editor.getBuffer().getPath() w/ editor.getPath()
2012-07-04 12:40:17 -06:00
Nathan Sobo
39ce15c3fa
Merge branch 'master' of github.com:github/atom
2012-07-04 12:34:56 -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
Corey Johnson
ab548bc946
Rename extension to requireExtension
2012-07-03 13:43:30 -07:00
Corey Johnson
2cb3a0ba69
Move extension keymap files into extension directory
2012-07-03 12:59:51 -07:00
Corey Johnson
263065171d
Use window.extension to load extensions from .atom file
2012-07-03 12:51:30 -07: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
e21d0a5d2a
Rename RootView.modifiedBuffers -> getModifiedBuffers
2012-07-02 19:49:05 -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
Nathan Sobo
8fbbd77a23
Commands terminating in a substitution restore their initial selection
2012-07-02 19:35:14 -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
Corey Johnson & Nathan Sobo
ef7121dfb3
File does not trigger 'contents-change' when its md5 does not change
2012-07-02 17:47:54 -07: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