Nathan Sobo
b6b8f235fd
Move and rename Buffer's 'anchors-updated' event
2013-01-04 14:03:37 -07:00
Kevin Sawicki & Nathan Sobo
ec13c38c7d
Add EditSession.transact and friends
...
`EditSession.transact` adds more semantics on top of `UndoManager`'s
version pertaining to restoring selections on undo/redo of the
transaction.
2013-01-04 12:42:09 -07:00
Kevin Sawicki & Nathan Sobo
428900fdba
Rename File 'remove' & 'move' events to passive voice
...
'remove' -> 'removed'
'move' -> 'moved'
2013-01-04 11:25:46 -07:00
Kevin Sawicki & Nathan Sobo
8e835acea4
Rename Buffer 'will-save' event to 'will-be-saved'
2013-01-04 11:25:45 -07:00
Nathan Sobo
5a409dde3c
Rename File and Directory 'contents-change' to 'contents-changed'
2013-01-03 18:16:19 -07:00
Kevin Sawicki
2971716060
Always use Git instance from project
...
This removes the need to open a new repository
each time a directory-view or file-view is displayed
and also when a status-bar is displayed for a buffer.
2013-01-02 17:21:42 -08:00
Nathan Sobo
6d9402b5c9
Rename Anchor and Buffer events to passive-voice scheme
2013-01-02 13:48:10 -07:00
Nathan Sobo
bb710d0ae0
Buffer.save only writes to disk if the buffer is modified
...
This prevents autosave from writing unmodified buffers to disk, which
was causing the tree view to rebuild directory contents based on the
write event just when switching tabs.
2013-01-02 04:23:03 -07:00
Nathan Sobo
acc0503684
Merge remote-tracking branch 'origin/master' into config
...
Conflicts:
src/app/keymap.coffee
src/extensions/outline-view/src/keymap.coffee
src/extensions/outline-view/src/tag-reader.coffee
src/packages/fuzzy-finder/spec/fuzzy-finder-spec.coffee
src/packages/fuzzy-finder/src/fuzzy-finder.coffee
2012-12-18 20:32:05 -07:00
Nathan Sobo
4b88a9f5ea
Expanded snippets are destroyed when the cursor leaves a tab stop
...
For this to work, I needed to make the updating of anchors transactional. Now, all anchors are updated and *then* they emit their events. That way when the cursor moves based on the user typing, the tab stop they're in has a chance to expand before we handle the move event. This prevents spurious cancellation of the snippet when typing on a tab stop.
2012-11-29 13:39:00 -07:00
Corey Johnson
69485724cd
Buffer emits a contents-modified event when it's contents differ from disk.
...
Including when the Buffer's file is removed via another process.
2012-11-29 12:05:05 -08:00
Corey Johnson
ada14a1cba
No longer read a File's contents from disk on creation
2012-11-29 11:26:42 -08:00
Corey Johnson & Nathan Sobo
e98b4f9a9b
Use file contents instead of md5 to determine disk change
2012-11-28 17:16:44 -08:00
Corey Johnson & Nathan Sobo
d6009df44e
Buffers retain path when file is deleted and can be re-saved
...
Path watching resumes once the file is saved again. This commit allows files to be created for as-yet nonexistent paths. We won't call `$native.watchPath` until we have at least 1 subscription to the file in JS and the file exists on disk.
Also, we moved execution of the path watcher callbacks until after the callbacks data structure is updated in order to avoid confusing behavior in specs.
2012-11-28 16:55:10 -07:00
Corey Johnson & Nathan Sobo
eb0414f4e7
Emit a contents-conflicted` event instead of contents-change-on-disk
2012-11-28 15:21:12 -07:00
Corey Johnson & Nathan Sobo
d5d4751776
Don't set Buffer's file to null when the file is deleted (retain path)
2012-11-28 13:40:37 -07:00
Corey Johnson & Nathan Sobo
bfb1742285
ctrl-a on an empty line stays on that same line.
...
Fixes #95
2012-11-19 10:02:31 -08:00
Nathan Sobo
4a84c5f8f9
Add 'stopped-changing' event to buffer. Fires 300ms after last change.
...
This will be used by the status bar and other expensive code that needs to respond to the buffer changing, but that we don't want running on every single keystroke when the user is typing quickly.
2012-11-14 15:33:44 -07:00
Kevin Sawicki
3df28ab375
Store Git instance in Buffer
...
Access it from StatusBar for checking
path status and current branch.
2012-11-05 12:03:59 -08:00
Kevin Sawicki
c8258894c7
Add Buffer.checkoutHead()
...
Move implementation from Editor
to Buffer for checking out the
HEAD revision of the current path
2012-11-05 11:52:33 -08:00
Nathan Sobo
aa3405cb2b
Cache the memory contents of Buffer for better performance
2012-11-01 14:09:58 -06:00
Nathan Sobo
887200de86
Use cached disk contents instead of signature for Buffer.isModified
...
Computing the signature was really slow for large files. Keeping a cached copy of the disk contents and comparing directly costs less in the benchmark. We'll have to turn on the status bar in benchmarks to see if the comparison is too expensive.
2012-10-31 12:36:14 -06:00
Nathan Sobo
007e032224
Expand selection linewise after triple-click (dragging or shift-click)
2012-10-30 14:48:33 -06:00
Kevin Sawicki
2531665570
Add Buffer.isEmpty()
...
To be used by Buffer.isModified() for when the
buffer has no backing file
2012-10-27 08:57:55 -07:00
Kevin Sawicki
acb5207d28
Treat file-less buffers as unmodified when empty
2012-10-26 13:56:21 -07:00
Corey Johnson & Nathan Sobo
adf00b60f3
Detect softTabs/hardTabs when an EditSession is created
2012-10-26 12:20:14 -06:00
Corey Johnson & Nathan Sobo
29351ee5fc
Move setIndentationForBufferRow and indentationForBufferRow to EditSession
2012-10-26 11:15:55 -06:00
Nathan Sobo
d310297fe7
Radically simplify the definition of "modified" for buffers
...
Now, we maintain md5 signatures for the on-disk and in-memory contents of the buffer. Whenever either contents change, we recompute the signature and store it on the buffer. We can tell if the buffer is modified by comparing these signatures. When the disk contents change, we compare the memory and disk signatures *before* recomputing the disk signature to determine whether to update the buffer or mark it as a conflict.
2012-10-25 13:08:38 -06:00
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