Commit Graph

62 Commits

Author SHA1 Message Date
Kevin Sawicki
0da869589e Use change event instead of buffer-change event
This will update the modified indicator after operations
are undone
2012-10-12 15:08:01 -07:00
Will Farrington
d5b0e7acd2 memoize Buffer @contentOnDisk so we don't re-read the whole file on every buffer-change event 2012-10-08 18:17:15 -10:00
Will Farrington
4b3505d9b5 Disable buffer modified indicator if buffer content matches content on disk 2012-10-08 17:55:35 -10:00
Chris Wanstrath
602f4ee233 trigger buffer-change after the change, not before 2012-10-08 20:28:18 -07:00
Will Farrington
12f145f959 Make Buffer#saveAs trigger the buffer-change instead 2012-09-29 23:21:45 -07:00
Will Farrington
fb7f5deb94 first spike of buffer modified indicator 2012-09-29 19:18:42 -07:00
Corey Johnson
533ad84d03 Buffer.scanInRange can do a case-insensitive search 2012-09-25 16:30:44 -07:00
Kevin Sawicki
7278bc62c6 Ensure start row is always >= 0
Previously if a file was a single line
it couldn't be deleted using the delete
line command because the start row would
index one row back which would be -1 and
therefore not be able to report a length
for use in the delete range.
2012-09-20 09:00:37 -07:00
Kevin Sawicki
b18627ab9b Add delete line support bound to meta-d key 2012-09-19 15:23:10 -07:00
Nathan Sobo
c3e748a17c WIP: Use rake to start compiling resources (like require.coffee) 2012-08-26 16:29:46 -05:00
Nathan Sobo
c2c8724ad0 Initial commit 2012-08-10 13:32:19 -06:00
Corey Johnson
34934d58f9 previousNonBlankRow returns null if passed row 0 2012-08-09 14:19:12 -07:00
Corey Johnson
9e53751717 Revert "Add setTextInBufferRange to edit session"
This reverts commit ea86ec401b.
2012-08-09 13:25:53 -07:00
Corey Johnson & Nathan Sobo
e8aaec43f7 WIP: Reworking auto-indent/outdent logic 2012-08-09 12:57:47 -06:00
Corey Johnson
ea86ec401b Add setTextInBufferRange to edit session 2012-08-09 10:33:25 -07:00
Corey Johnson & Nathan Sobo
7fe6a05594 Folding no longer relies on Ace.
Indentation is used to determine foldable regions, if the last line matches TextMate's foldEndRegex it is included in the foldable region.
2012-08-08 17:42:11 -07:00
Corey Johnson
81f83482b0 Rename File.getName and Directory.getName to .getBaseName 2012-08-02 11:37:49 -07:00
Corey Johnson
0384f025dd Add Buffer.isInConflict() 2012-07-26 11:00:16 -07:00
Corey Johnson
42299c6a71 When the active edit session is modified, and its file is then modified by the file system, it displays an alert. 2012-07-26 10:59:58 -07:00
Nathan Sobo
454557b502 Merge branch 'master' into global-find
Conflicts:
	spec/extensions/command-panel-spec.coffee
	src/app/buffer.coffee
	src/extensions/command-panel/command-panel.coffee
	src/extensions/command-panel/keymap.coffee
2012-07-24 17:59:49 -06:00
Nathan Sobo
c05fa7dc6f Merge branch 'master' into global-find
Conflicts:
	src/app/buffer.coffee
2012-07-20 19:01:38 -06:00
Corey Johnson & Nathan Sobo
b959d5aa37 Buffers are memoized on project by path 2012-07-18 12:56:09 -07:00
Corey Johnson
9f004ad09c retain and release methods return this 2012-07-18 10:40:34 -07:00
Corey Johnson & Nathan Sobo
c3fe9aa0b3 Implement refcounting scheme on Buffer 2012-07-17 14:24:33 -06:00
Corey Johnson
5914b6cc2a Add Buffer.reload() 2012-07-16 16:12:09 -07:00
Corey Johnson
611eb93219 Buffer stores a is modified on disk flag 2012-07-16 16:11:52 -07: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
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
822b85a8be Make @probablycorey happier 2012-07-05 17:18:11 -06:00
Nathan Sobo
2ddd5820f7 💄 Rename lastLine -> getLastLine 2012-07-04 12:59:54 -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
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
c3d7d3566f Buffer listens for changes to file and triggers 'contents-change' event 2012-06-29 15:09:31 -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
Nathan Sobo
4c8aeb16bb Merge branch 'master' into snippets
Conflicts:
	src/app/window.coffee
2012-06-20 17:11:25 -06: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
David Graham & Nathan Sobo
5b8cc8a6b6 Snippets matching the cursor's word prefix are inserted on 'tab' events 2012-06-19 17:47:09 -06:00
Nathan Sobo
5f20b09284 Remove Buffer.proto.getMode. All ace interaction should be mediated by LanguageMode 2012-06-13 18:09:28 -06:00
Corey Johnson
b841a04093 Don't serialize pathless buffer text 2012-06-12 15:12:58 -07:00
Corey Johnson
1fb8852fc3 Saving a buffer sets its modified flag to false 2012-06-12 11:29:38 -07:00
Corey Johnson
9339791260 Set modified flag to true when there is a buffer change. 2012-06-12 10:52:11 -07:00
Kevin Sawicki
f890b326e2 Use xml mode when extension is xml 2012-06-11 14:48:52 -07:00
Kevin Sawicki
9172b23e8f Use java mode when extension is java 2012-06-11 14:48:52 -07:00