Commit Graph

56 Commits

Author SHA1 Message Date
Corey Johnson
eaf7ee8ec1 Only emit editor-open event once (on first attachment) 2012-04-19 18:12:55 -07:00
Corey Johnson & Nathan Sobo
800f16bb29 Editor emits an editor-open event when attached 2012-04-19 17:56:08 -07:00
Corey Johnson & Nathan Sobo
038b491247 Add 'mini' option to editor, which styles it with auto-height, no gutter, and overflow hidden on scroller 2012-04-19 16:45:57 -06:00
Corey Johnson & Nathan Sobo
49b5263fd7 Listen on Editor for bubbled textInput events instead of directly on hidden input 2012-04-19 10:14:45 -06:00
Corey Johnson & Nathan Sobo
5e1d7c774c Serialized Editor state no longer contains Buffer objects 2012-04-18 15:57:58 -07:00
Corey Johnson & Nathan Sobo
a8d9d1690e Autocomplete preempts Editor move-up and move-down events and unsubscribes from Buffer change events when Editor is removed. 2012-04-18 15:56:09 -07:00
Corey Johnson
d41ac6626f Autocomplete extends View 2012-04-17 17:37:19 -07:00
Nathan Sobo
c673c5114e Ensure that Editor.proto.serialize returns a copy of each edit session 2012-04-13 14:29:58 -06:00
Corey Johnson & Nathan Sobo
65c624f2bf Remove RootView.proto.editorRemoved. Transfer remaining logic to Editor.proto.remove 2012-04-13 14:22:45 -06:00
Corey Johnson & Nathan Sobo
57b205d508 When a Pane is removed, layout of #panes div is adjusted appropriately 2012-04-13 12:49:59 -06:00
Corey Johnson & Nathan Sobo
1b2b1a324d Add a mock-based test for Editor.prototype.split and ensure it doesn't raise exceptions when not in a pane 2012-04-13 11:40:29 -06:00
Corey Johnson & Nathan Sobo
54a15856bb Use Editor.deserialize in Editor.prototype.copy and add a spec for it 2012-04-13 11:39:57 -06:00
Corey Johnson & Nathan Sobo
da53fa1ba3 Replace RootView.proto.addPane with Pane.proto.split method 2012-04-13 10:47:45 -06:00
Corey Johnson & Nathan Sobo
dac91d1f29 Editor and RootView have deserialize class method 2012-04-12 16:26:59 -07:00
Corey Johnson & Nathan Sobo
1bd93e5565 Factored out PaneRow and PaneColumn which have serialize and deserialize methods. 2012-04-12 16:21:09 -07:00
Nathan Sobo
8513e60903 Editor saves all edit sessions when window is refreshed 2012-04-12 15:46:44 -06:00
Corey Johnson & Nathan Sobo
416a15e3af Editors in #panes are always contained by .pane wrappers
This prepares us to refactor the split view and editor state code into Column, Row, and Pane objects.
2012-04-11 18:37:22 -06:00
Nathan Sobo
75754fe62e Merge branch 'master' of github.com:github/atom 2012-04-11 14:59:03 -06:00
Nathan Sobo
535fba1af8 Previously focused editor is re-focused on refresh
The isFocused property has now been added to editor state. When an editor is attached to the dom, it focuses itself automatically if and only if the @isFocused property is true. The @isFocused property gets assigned when the editor is constructed by the root view with its previous state.
2012-04-11 14:58:51 -06:00
Corey Johnson
5097218aa2 meta-{ goes to previous buffer 2012-04-11 13:44:07 -07:00
Corey Johnson
bf367863ba meta-} goes to next buffer 2012-04-11 13:44:07 -07:00
Corey Johnson
4bdc908b98 Store editorStates as an array on Editor 2012-04-11 13:44:07 -07:00
Nathan Sobo
f97ffa8826 Fix bug where clicking an editor pane didn't focus the editor
We don't need to return false from the click handler. It was an experiment when debugging scrolling that I left in accidentally.
2012-04-11 14:24:00 -06:00
Nathan Sobo
bc24b6a73c Always fire attach events (change from one to on) 2012-04-10 19:28:36 -06:00
Nathan Sobo
ae5d64f06d Change Editor.proto.split method to use new RootView.proto.addPane method.
RootView.proto.addPane takes a view to add, a sibling to add it next to, an axis along which to add (row or column), and a side (before or after)
2012-04-10 19:27:50 -06:00
Nathan Sobo
5d8affb3e4 Editor.initialize calls setEditorState to set buffer, cursor position, etc 2012-04-10 17:39:41 -06:00
Nathan Sobo
447b0598f9 Replace EditSession with dumb editor state hash, which can be supplied on editor construction. 2012-04-10 17:35:49 -06:00
Corey Johnson
afceacefc8 meta-[ outdents selected lines 2012-04-10 10:18:39 -07:00
Corey Johnson
ec221bfee0 meta-] indents selected lines 2012-04-10 09:55:13 -07:00
Corey Johnson & Nathan Sobo
a21082395d 💄 2012-04-09 11:41:04 -07:00
Corey Johnson & Nathan Sobo
f3372f08de Ctrl-k cuts to the end of the line 2012-04-09 12:34:30 -06:00
Nathan Sobo
9da86982a8 WIP: Set cursor position correctly after inserting a hard tab.
Tests pass but still some issues on repeated tab insertion.
2012-04-06 13:03:30 -06:00
Nathan Sobo
ce91d50c29 Pass clipping options in setting screen position and translating buffer position for screen position
This allows Cursor.proto.moveRight to avoid pre-clipping its position. It just passes the appropriate clipping options when setting its screen position.
2012-04-06 12:29:40 -06:00
Nathan Sobo
656c8318f2 Shift-triple-click expands the selection over the clicked line 2012-04-06 11:07:19 -06:00
Nathan Sobo
76a846aacc Shift-double-click expands the selection over the clicked word
Also factored `get(Beginning|End)OfCurrentWordBufferPosition` methods out of `moveTo(Beginning|End)OfWord` on Cursor. They are used by a `getCurrentWordBufferRange` method, which Selection now uses to find the range of the current word.
2012-04-05 19:41:34 -06:00
Nathan Sobo
2fc3f78e26 Shift-click creates a selection
It would be nice to handle shift-double-click and shift-triple-click as well.
2012-04-05 18:12:48 -06:00
Nathan Sobo
a3686da496 Move atom.tabText to a property on Editor.prototype for more locality 2012-04-05 17:55:15 -06:00
Nathan Sobo
aba968acd9 Tab key inserts spaces or a tab character depending on Editor.prototype.softTabs setting 2012-04-05 17:39:40 -06:00
Nathan Sobo
77366b5497 Remove unused editor bounds methods 2012-04-05 09:38:50 -06:00
Nathan Sobo
845bc8fde4 Merge branch 'master' of github.com:github/atom 2012-04-04 18:27:40 -06:00
Nathan Sobo
1b848307d4 Restore selections on redo 2012-04-04 18:27:34 -06:00
Nathan Sobo
cbeb351de4 Restore selections after undo
This only restores changes made via the CompositeSelection… this makes sense because this is the only way to make changes interactively. Any other changes are made via the api or a command line and should not modify selections when they are undone. Still need to test restoration after redo.
2012-04-04 18:04:32 -06:00
Corey Johnson
fb02290972 Sync multiple cursor animations 2012-04-04 15:01:38 -07:00
Corey Johnson
2489e19bb7 CompositeCursor.addCursor takes an optional screenPosition argument 2012-04-04 14:08:30 -07:00
Corey Johnson
6ad50b379f Make it more obvious that Editor's scroll methods take pixelPositions 2012-04-04 11:19:17 -07:00
Nathan Sobo
8d05802290 Redesign commands around multiple selections
Every command returns an array of buffer ranges to select from its execute method. The composite command loops through each current selection with each command, then sets the new selection to the aggregated buffer ranges returned by all commands at that step.
2012-04-04 12:09:33 -06:00
Nathan Sobo
4abf41e173 Merge branch 'master' of github.com:github/atom 2012-04-04 11:09:55 -06:00
Nathan Sobo
92cc23a9bb Substitutions work with multiple selections
The `execute` method on commands now has a second range parameter. The composite command loops through all selected ranges and calls execute on each subcommand for each range. Still need to update the `.` address to work with the new scheme.
2012-04-04 11:09:30 -06:00
Corey Johnson
2465372bd4 Multi-cursor scrolling is based on the last created cursor 2012-04-03 16:34:21 -07:00
Corey Johnson
d016cc27d3 Move autoScrolling methods from cursor to editor
Scroll methods are now Editor.scrollTo(), Editor.scrollHorizontally() and Editor.scrollVertically()

Editor.scrollTo() can only be called once per runloop
2012-04-03 16:12:04 -07:00