Kevin Sawicki & Nathan Sobo
59d0742c17
Remove Anchor and AnchorRange. They're fully replaced by markers.
...
We're still leaking markers for selections and cursors. We need to
clean that up before merging.
2013-02-05 18:15:48 -07:00
Kevin Sawicki & Nathan Sobo
5a1de9fa44
Add specs for truthiness of marker position assignment return values
2013-02-05 16:33:59 -07:00
Kevin Sawicki & Nathan Sobo
75e040b73b
Merge remote-tracking branch 'origin/dev' into markers
...
Conflicts:
src/app/editor.coffee
2013-02-05 16:07:05 -07:00
Kevin Sawicki & Nathan Sobo
c893f0c338
Add Buffer.markersForPosition and coerce marker ids to strings
2013-02-05 15:50:54 -07:00
Nathan Sobo
1d30605f7f
Convert selection and cursor fully over to markers.
2013-02-05 13:39:00 -07:00
Kevin Sawicki
ad3c18077c
Compare against EOF position when clipping
...
Previously the column could potentially be set to
zero since a Math.min comparison was used for the
length of an already adjusted row.
2013-02-05 12:08:17 -08:00
Nathan Sobo
afe0a6570a
Reduce observation to single observeMarker method on display buffer
...
It will call the observer callbacks with the buffer and screen positions
of the head and tell each time any of these values is changed.
2013-02-04 21:24:06 -07:00
Nathan Sobo
58450d6a65
Give Buffer only a single observeMarker method
...
It will fire the callback whenever the marker's head or tail position
changes, and it's up to the subscriber to use the information how they
want to.
2013-02-04 20:35:30 -07:00
Nathan Sobo
44e48d42ea
Add Buffer.observeMarkerRange
2013-02-04 11:27:39 -07:00
Nathan Sobo
bd96db781e
Pass old/new buffer and screen positions to marker position observers
...
This is needed by the snippets package, which needs to know where the
cursor was previously when it moves to decide whether to cancel the
current snippet.
2013-02-02 18:00:35 -07:00
Nathan Sobo
aa076a0bf2
Remove focused specs
2013-02-02 16:45:15 -07:00
Nathan Sobo
e53403718a
Tell marker head observers if a move was caused by a buffer change
...
This is used by cursor to only autoscroll when the marker head is
explicitly moved, so that passive movements caused by buffer insertions
don't trigger autoscrolling.
2013-02-02 16:17:14 -07:00
Nathan Sobo
1bbb954239
EditSession specs passing after converting Selection to use markers
...
Still a bit of a mess though...
2013-01-31 18:26:29 -07:00
Nathan Sobo
628701fd3a
Finish converting cursors to use markers.
...
The model layer works at least… haven't tested the view. Will test out
the view once I get the selection model working.
2013-01-31 15:52:28 -07:00
Nathan Sobo
ec521b3fd3
Add ability to cancel marker head position observations
2013-01-31 14:11:28 -07:00
Nathan Sobo
bc44540b10
Start adding ability to observe marker head positions
2013-01-31 14:00:01 -07:00
Nathan Sobo
1d1c613f5b
Allow buffer marker head and tail positions to be manipulated
2013-01-30 22:16:08 -07:00
Nathan Sobo
5dd142b966
Allow markers to be created in a reverse orientation
...
This means that the head of the marker precedes its tail in the buffer.
This will be important if we want to build selections on top of markers.
2013-01-30 21:44:57 -07:00
Nathan Sobo
d8ffdcd6bd
Allow markers to be created with just a position
...
When a marker is created with just a position, it only gets a head
position and has no tail position.
2013-01-30 21:37:57 -07:00
Nathan Sobo
e02f9cd830
Rename Buffer.createMarker to markRange
2013-01-30 17:41:04 -07:00
Nathan Sobo
dfe0cad217
Replace anchor point/range with a single concept: markers
...
A "marker" is basically like a persistent selection/cursor composite,
having a head and a tail. The "head" is like the cursor in a selection,
and the "tail" is like the part of the selection that doesn't move. My
goal is for markers to be the only construct used to track regions
in the buffer. I want to replace anchors with them.
2013-01-30 16:52:09 -07:00
Nathan Sobo
bcd9d5d2b9
Rename addAnchorPoint to createAnchorPoint
2013-01-30 13:57:39 -07:00
Nathan Sobo
113a8fa279
Merge remote-tracking branch 'origin/dev' into better-anchors
...
Conflicts:
src/app/cursor.coffee
src/app/editor.coffee
2013-01-30 12:59:04 -07:00
Nathan Sobo
ec3a1a80cd
Restore invalidated anchor points on undo/redo of a change
2013-01-30 12:48:29 -07:00
Nathan Sobo
30909a8e8f
Move anchor points to buffer; restore invalidated points on undo
2013-01-30 12:23:42 -07:00
Kevin Sawicki
1a04fa31d1
Clip range specified to Buffer.getTextInRange()
2013-01-29 15:35:14 -08:00
Kevin Sawicki & Nathan Sobo
98614592af
Store line endings on a per-line basis in Buffer
...
The line ending for each line is recorded and reused
when lines are modified or inserted.
Closes #166
2013-01-27 16:01:22 -08:00
Kevin Sawicki
bc3646f180
💄
2013-01-23 16:24:40 -08:00
Kevin Sawicki
39fd4f7059
Remove extra subscribeToFile() call
...
This was causing an event listener to leak
on each call to save()
Closes #152
2013-01-22 14:44:34 -08:00
Nathan Sobo
0a08d03c68
Rename Buffer, TokenizedBuffer, and Selection events
2013-01-04 13:59:11 -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
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
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
ae00e888fd
un-f buffer spec
2012-11-29 10:36:56 -08:00
Corey Johnson
04c4c45190
💄
2012-11-29 08:53:39 -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
ac84a8ab0a
Destroy buffer to avoid leaking a path watch
2012-11-28 17:13:32 -07: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
f9563f5e55
Fix PathWatcher failures
...
Now when a file is removed, we always remove its subscriptions and its kevent.
2012-11-19 13:16:14 -07:00
Corey Johnson
d9a3fbd910
BufferSpec doesn't double release buffers
2012-11-15 13:16:12 -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
Nathan Sobo
632bba5609
Kill dead code in spec
2012-11-14 15:13:50 -07:00
Corey Johnson
dbf8639375
Rename anchor.ignoreEqual to anchor.ignoreChangesStartingOnAnchor
2012-10-31 14:27:31 -07:00
Corey Johnson
84ea1017f4
Anchor.ignoreEqual works properly
...
The anchor ignores buffer changes when ignoreEqual is true and the oldRange.start == anchor.position
2012-10-31 14:27:21 -07:00