Commit Graph

326 Commits

Author SHA1 Message Date
Nathan Sobo
fc9bf38a2a *Must* use get and set to access config values.
The `config` object no longer stores config properties directly. Instead it stores them on an internal `settings` object, which makes it easier to serialize settings without getting them mixed up with non-setting state on the `config` object.
2012-12-17 20:56:37 -07:00
Nathan Sobo
a7d1a29748 Use config.get/set methods. config.update now takes no args. 2012-12-17 18:52:20 -07:00
Nathan Sobo
4538a70859 Add config.editor.autosave 2012-12-16 11:30:06 -08:00
Corey Johnson & Nathan Sobo
6b12288a82 💩 2012-12-14 16:38:22 -08:00
Corey Johnson & Nathan Sobo
e6362af711 Rename subscription.destroy to subscription.cancel 2012-12-14 16:38:04 -08:00
Corey Johnson & Nathan Sobo
54c0c277ed 💩 2012-12-14 15:47:51 -08:00
Corey Johnson & Nathan Sobo
8a675fd538 Use config.update w/ a key path everywhere we update the config 2012-12-14 15:21:36 -08:00
Nathan Sobo
7bf0022d3f Make the font size 16 in specs, because a few specs depend on it 2012-12-12 16:39:30 -08:00
Nathan Sobo
c9b7618ea0 Move custom invisible glyph spec to editor spec 2012-12-12 15:55:12 -08:00
Nathan Sobo
c19c9e0d1f Save config changes on update 2012-12-12 15:49:01 -08:00
Nathan Sobo
3c2b84a46d Add config.editor.fontSize 2012-12-12 15:23:36 -08:00
Nathan Sobo
8088e4d90c Add config.editor.invisibles field for customizing invisible glyphs. 2012-12-12 14:45:58 -08:00
Nathan Sobo
b3303bc21d Add config.editor.showInvisibles 2012-12-12 13:50:58 -08:00
Kevin Sawicki
339eeac0d8 Remove unneeded spyOn calls 2012-12-11 15:58:59 -08:00
Kevin Sawicki
b848379420 Support scrolling to buffer and screen positions 2012-12-11 15:54:01 -08:00
Nathan Sobo
4684bc5942 Redraw gutter when switching to a shorter buffer
This ensures that we don't leave too many line numbers on the screen for the current file.
2012-12-04 13:25:13 -07:00
Nathan Sobo
5b143d4b93 Add 'autosave' option, which saves when unfocusing or switching tabs 2012-11-30 14:11:27 -07:00
Corey Johnson & Nathan Sobo
d4f44f6554 Give selection view '.selection' class and region divs '.region' class 2012-11-30 12:52:38 -07:00
Corey Johnson & Nathan Sobo
c7363b3347 Highlight selection w/ animation when autoscroll is true 2012-11-30 12:44:12 -07:00
Corey Johnson & Nathan Sobo
ac0e3095ec Only autoscroll selections to center if they are offscreen 2012-11-30 11:40:27 -07:00
Corey Johnson & Nathan Sobo
f9c7c08641 Selected results of a find operation are centered in the viewport 2012-11-29 18:52:34 -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
Nathan Sobo
d47a82f585 Handle selection dragging when cursor goes off-screen 2012-11-26 17:21:50 -07:00
Nathan Sobo
69ec6b5441 Add the 'editor:edit-session-removed' event to Editor 2012-11-20 16:03:11 -07:00
Nathan Sobo
e508d73dd4 Always provide the EditSession and its index on EditSession events 2012-11-20 15:49:52 -07:00
Nathan Sobo
4a373a9173 Add 'editor:edit-session-added' event to Editor 2012-11-20 15:43:57 -07:00
Nathan Sobo
056c6c5af2 Add 'editor:active-edit-session-changed' events to Editor 2012-11-20 15:23:30 -07:00
Nathan Sobo
a1cff240b6 Use 'blink-off' css class to blink the cursor when editor is focused
Rather than managing the visibility directly, a class makes it easy. The cursors will always be toggling this class on and off in the background, but only on the focused editor will it actually have an effect.
2012-11-14 21:43:06 -07:00
Nathan Sobo
0af952fc13 💄 2012-11-14 21:42:03 -07:00
Nathan Sobo
185ca22488 Make cursor blink by changing CSS visibility with setInterval
This is actually more efficient than the CSS animation we were doing previously, because it doesn't force the cursor to be sampled at 60 FPS for something that changes around twice a second.
2012-11-14 20:43:34 -07:00
Nathan Sobo
3e11b38eaf Disable spec for cursor idle class. We're going to blink it manually. 2012-11-14 13:13:39 -07:00
Corey Johnson & Nathan Sobo
041dc2b6b0 Replace calls to renderLines w/ resetDisplay in Editor 2012-11-13 17:21:27 -07:00
Corey Johnson & Nathan Sobo
cef9ce6ca7 Add needsUpdate and needsAutoscroll properties to cursor views
Then in the editor, we update and autoscroll only the views that need it. Autoscrolling is suppressed when resetting the display so that we honor the scroll positions of the active EditSession.
2012-11-13 17:20:48 -07:00
Nathan Sobo
55bab0fbe0 Un F 2012-11-13 14:18:12 -07:00
Corey Johnson & Nathan Sobo
b5efec308a wip: updateDisplay 2012-11-13 12:08:41 -08:00
Corey Johnson & Nathan Sobo
9c0f1d428f Rename updateAppearance to updateDisplay 2012-11-13 11:21:46 -08:00
Nathan Sobo
06204a40dd Un-F. 2 failures left in suite. 2012-11-09 14:27:19 -07:00
Nathan Sobo
3bc11ede77 Set the lines div height explicitly so it can be > 100% of parent
All editor specs pass
2012-11-09 14:25:59 -07:00
Nathan Sobo
c257a989be Account for 20 extra pixels on right of lines div in spec 2012-11-09 14:05:22 -07:00
Nathan Sobo
0b9e22483e Update spec to match stricter maintenance of lastRenderedScreenRow 2012-11-09 13:40:49 -07:00
Nathan Sobo
4a3dbedb71 Fix spec to allow for 20 extra pixels to right of the lines 2012-11-09 13:28:51 -07:00
Corey Johnson & Nathan Sobo
7c16c48e2a Ensure underlayer and overlayer are always the same width as lines
Also… simplify CSS rules for lines element. No display table or padding, instead we just set the min width when typing.
2012-11-09 11:12:33 -07:00
Nathan Sobo
1f94b2aacc WIP: Handling display buffer changes. Cursor, selection specs failing
That's because the new CodeMirror-inspired line update code assumes that lines are the only thing in the rendered lines div.
2012-11-09 08:46:33 -07:00
Nathan Sobo
1d46da55da WIP: Borrowing from code mirror to update lines. Scrolling / resizing work, but not much else 2012-11-09 07:31:30 -07:00
Nathan Sobo
312f64d200 Don't make hidden input a child of Editor's scrollView
If the input element is a child of the scroll view, then focusing it can end up changing the scroll position of the view behind our backs. We *only* want to scroll the view via our interface on editor, because a bunch of of special code needs to run when we scroll. We can't just have the browser scrolling that view around willy-nilly.
2012-11-07 19:47:31 -07:00
Nathan Sobo
19c8a39fc8 Don't autoscroll to bottom of buffer on selectAll 2012-11-07 16:01:10 -07:00
Nathan Sobo
144cfadb15 Update selection rendering when font size changes 2012-11-07 14:22:43 -07:00
Nathan Sobo
df392359f9 When font size changes, correctly adjust scrollable height
This requires updating the padding of the rendered lines and then adjusting the vertical scrollbar content height before updating any of the rendered lines. This fixes (hopefully all of) the rendering issues when adjusting the font size.
2012-11-07 14:09:31 -07:00
Nathan Sobo
66efc80373 Fix broken spec 2012-11-07 13:05:03 -07:00
Nathan Sobo
d44e116321 Don't highlight the current line unless the selection is empty 2012-11-07 12:11:33 -07:00