Commit Graph

1994 Commits

Author SHA1 Message Date
Nathan Sobo
6beee10160 Replace anchor w/ marker in selection destruction spec 2013-02-02 16:41:57 -07:00
Nathan Sobo
12425b796c Tweak specs now that buffer changes don't autoscroll the cursor 2013-02-02 16:34:28 -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
c865b9f53a Update selection autoscroll specs with 3-valued logic
If autoscroll is true, we center the view on the selection. If false,
we do no autoscrolling at all. And if undefined we autoscroll to the
cursor.
2013-02-02 15:58:35 -07:00
Nathan Sobo
3d8406f5a3 Clip screen positions before translating to buffer positions 2013-02-02 15:07:17 -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
074c1815d0 Start adding marker methods to DisplayBuffer
Whereas marker methods on buffer take for granted that everything is
in buffer coordinates, methods on the DisplayBuffer offer both
screen and buffer coordinate versions of the marker API.
2013-01-30 22:46:52 -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
0e67f35748 Start on marker interface in DisplayBuffer 2013-01-30 21:04:52 -07:00
Nathan Sobo
fd99c795b9 Merge remote-tracking branch 'origin/dev' into better-anchors 2013-01-30 20:45:31 -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
Kevin Sawicki
1acf0b870f Support translating points and ranges 2013-01-30 13:49:10 -08:00
Corey Johnson
c650deea01 Merge branch 'font-config' into dev 2013-01-30 13:24:12 -08:00
Nathan Sobo
bcd9d5d2b9 Rename addAnchorPoint to createAnchorPoint 2013-01-30 13:57:39 -07:00
Nathan Sobo
063cb71175 Spelling 💄 in spec 2013-01-30 13:24:15 -07:00
Corey Johnson
9b1cb29e1f Don't store fontSize and fontFamily as instance variables 2013-01-30 12:20:02 -08:00
Corey Johnson
29ccd271de Set font-size css property using style tag 2013-01-30 12:11:17 -08:00
Corey Johnson
9ea29b2899 Set font-family css property using style tag 2013-01-30 12:07:23 -08: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
Kevin Sawicki
f90d29262c Use octicon as folding indicator 2013-01-30 11:50:29 -08:00
Kevin Sawicki
8dbcefa932 Style color of folded line numbers 2013-01-30 11:50:23 -08: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
Corey Johnson
e7c3282f53 Add font-family spec 2013-01-30 10:15:34 -08:00
Corey Johnson & Kevin Sawicki
4db876aed1 Deleting before fold no longer unfolds after undo
Use same row delta computation for updating start and
end rows in folds.
2013-01-30 09:10:26 -08:00
Corey Johnson
97fa9d522a end/beginning word implementations are now more similar 2013-01-30 08:39:32 -08:00
Nathan Sobo
6c7b93872c Add failing specs for undoing changes that surround anchor points 2013-01-29 18:29:42 -07:00
Nathan Sobo
0ecfba3262 WIP: Start adding new anchorPoint API on edit session
These will replace anchors, but they won't be stored on the Buffer
at all. The API user will access them by a returned scalar id rather
than calling methods on the returned anchor object directly.
2013-01-29 18:21:56 -07:00
Corey Johnson
46aefc75ab Make EditSession specs match vim style word behavior 2013-01-29 16:57:23 -08:00
Corey Johnson
dac92ca6e7 Make cursor.moveCursorToBeginningOfWord behave like vim 2013-01-29 16:57:22 -08:00
Corey Johnson
b66efbe3e7 cursor.getBeginningOfCurrentWordBufferPosition behaves like vim 2013-01-29 16:57:22 -08:00
Kevin Sawicki
1303e58a87 Don't move trailing newline for multiline selections 2013-01-29 16:51:33 -08:00
Kevin Sawicki
1a04fa31d1 Clip range specified to Buffer.getTextInRange() 2013-01-29 15:35:14 -08:00
Nathan Sobo
3f50dbe1f8 💄 2013-01-29 16:00:45 -07:00
Kevin Sawicki
096566ab2a Bind ctrl-meta-down to move line(s) down
Refs #134
2013-01-29 14:58:52 -08:00
Kevin Sawicki
ad7e4b63c0 Bind ctrl-meta-up to move line(s) up
Refs #134
2013-01-29 14:58:51 -08:00
Nathan Sobo
2380fa3445 Handle 'autoscroll' entirely in Cursor instead of in Anchor
This commit makes autoscroll a 3-valued property on the cursor. If it
is set to true or false, that setting will stick until the cursor's
next visual update. That means we can explicitly move the cursor with
autoscroll set to false, but also still autoscroll by default when the
cursor's anchor moves on its own.
2013-01-29 12:11:43 -07:00
Kevin Sawicki
e792265076 Trigger grammars-loaded event on syntax 2013-01-28 14:34:49 -08:00
Kevin Sawicki
ad8dd767e5 Don't allow web worker grammars to be registered
Grammars are already loaded at the beginning of the
specs synchronously and should not be overridden
when testing the background load task.
2013-01-28 14:23:18 -08:00
Corey Johnson & Nathan Sobo
493ed5f006 Merge branch 'web-workers' into dev 2013-01-28 15:02:57 -07:00
Kevin Sawicki
d84c600679 Don't add CR invisible if line is soft wrapped 2013-01-28 13:33:46 -08:00
Kevin Sawicki
fa5ceedfe0 Don't add EOL invisible if line is soft wrapped 2013-01-28 13:22:32 -08:00
Kevin Sawicki
ee5d70b65d Terminate worker when all packages have been loaded 2013-01-27 22:38:11 -08:00
Nathan Sobo
96b0cde85a Merge branch 'dev' into web-workers 2013-01-27 18:53:59 -07:00