Corey Johnson & Nathan Sobo
5b7e96067a
moveCursorToBeginningOfWord works when preceded by a blank line
2012-10-30 12:05:46 -06:00
Corey Johnson & Nathan Sobo
46fc7f2375
Redefine word regex to consider sequences of non-word chars as words
...
This does *not* include newlines. Doing this makes it possible to double-click regions of whitespace to select them just as you can select a word. It also makes word movement bindings behave similarly to TextMate.
2012-10-30 11:56:05 -06:00
Corey Johnson & Nathan Sobo
8c7152a59b
Eliminate 'move-cursor-to-next-word' command
...
We have move-to-end-of-word and move-to-beginning-of-word, which is what we use for the current keybindings.
2012-10-30 11:56:05 -06:00
Nathan Sobo
88e246b622
Hide the cursor when the selection is not empty
2012-10-29 15:51:32 -06:00
Corey Johnson & Nathan Sobo
0aa9f8de57
Indent works with hard tabs
2012-10-26 11:15:55 -06:00
Nathan Sobo
839d57d819
Use existing line's indentation level if inserting normalized lines within it
...
If we're pasting multiple lines starting inside an already existing line, we never want to auto indent. We should just take its existing indentation level. Also, we strip the leading whitespace off the first line we're inserting, assuming it's already being represented by the indentation of the line we're onto which we're appending it.
2012-10-23 16:17:26 -06:00
Kevin Sawicki
9ba3b74a9d
Add support for Page Up and Page Down keys
2012-09-18 19:53:23 -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 & Nathan Sobo
926067164d
Buffer updates anchors when it changes instead of EditSession
2012-07-13 17:42:41 -06:00
Nathan Sobo
569359b687
Don't destroy selection/cursor anchors when encompassed by a change
...
Add the 'strong' option to anchors. If anchors are 'strong' instead of being destroyed by encompassing changes they move to the beginning of the change range.
2012-07-05 15:20:28 -06:00
Nathan Sobo
1710ecc8a9
Merge branch 'master' into snippets
2012-06-21 17:57:40 -06:00
Nathan Sobo
8fa5723be9
When buffer or display-buffer change, update the position of all anchors on EditSession.
...
Cursors and selections no longer need to handle buffer/display-buffer changes directly. They register anchors with the EditSession, and subscribe to changes in their position instead. This opens up the anchor facility for use by extensions that want to track the screen position of a point in the buffer as the buffer and display buffer change.
2012-06-21 17:57:23 -06:00
Nathan Sobo
7f1b094ed2
Make Cursor and Selection create anchors via EditSession.prototype.addAnchor
2012-06-21 17:29:21 -06:00
David Graham & Nathan Sobo
5b8cc8a6b6
Snippets matching the cursor's word prefix are inserted on 'tab' events
2012-06-19 17:47:09 -06:00
Nathan Sobo
f99ce5782c
💄
2012-06-15 16:03:54 -06:00
Corey Johnson & Nathan Sobo
e38ade2730
Bugfix: Backspace in middle of line below a fold no longer deletes the newline preceding the cursor
2012-06-14 17:08:14 -06:00
Corey Johnson & Nathan Sobo
1dfbaf67d1
Delete at the end of a line above a fold deletes the folded lines (leaving a newline)
2012-06-14 16:58:47 -06:00
Nathan Sobo
09a05141d0
Remove old unused Anchor class
2012-06-13 11:06:41 -06:00
Corey Johnson & Nathan Sobo
feb0c6af85
Anchor.setBufferPosition clips position by default
2012-06-12 16:49:48 -07:00
Nathan Sobo
b0d1dd217b
Cursor *model* clears selection when cursor moves, not the view.
2012-06-08 18:49:18 -06:00
Nathan Sobo
7eb01272ed
Move text insertion and auto indent/outdent code from the selection view to the model
2012-06-08 12:31:29 -06:00
Nathan Sobo
608c4f48bf
Remove more logic from cursor view
2012-06-07 16:58:45 -06:00
Nathan Sobo
f406786a3a
Editor subscribes to EditSession for screen line changes. Remove more movement logic from cursor view.
2012-06-07 16:31:40 -06:00
Nathan Sobo
d872d12e04
Transfer word movement methods into cursor model
2012-06-07 15:33:01 -06:00
Nathan Sobo
21ae28657c
Move moveTo(Beginning/FirstCharacter/End)OfLine methods to cursor model
...
Also, implement move to end of line by adding a clip option to setBufferPosition and passing [row, Infinity]
2012-06-07 11:28:40 -06:00
Nathan Sobo
fccc88acaf
Move moveLeft/Right/ToTop/ToBottom methods into cursor model
2012-06-07 10:57:21 -06:00
Nathan Sobo
ddf29e89ec
Slave CursorView's screen position to its cursor model. Move moveUp and moveDown methods into cursor model.
2012-06-07 10:47:30 -06:00
Nathan Sobo
7387c553c3
Start introducing Cursor model in EditSession
...
The old cursor view still does most of the work, but to add a new cursor view we now must add a cursor model to the edit session at the correct position. The editor watches the 'add-cursor' event on edit session and add a corresponding CursorView to the CompositeCursor whenever a model is added. Next step: have the cursor view observe the cursor model and shadow its changes in position.
2012-06-06 21:52:19 -06:00
Nathan Sobo
e167afd794
Rename Cursor to CursorView in preparation for a Cursor model in EditSession
2012-06-06 18:01:08 -06:00
Nathan Sobo
c291cd1bb3
Cache hidden/visible state of cursor to avoid extra DOM hit when updating its appearance
2012-05-30 10:51:27 -06:00
Nathan Sobo
e2ca3814a9
Hide the cursor when it is on a fold line
2012-05-25 12:35:32 -07:00
Corey Johnson
399fc71b3c
Make Atom SpacePen view's default to empty object (where needed)
2012-05-16 10:35:50 -07:00
Corey Johnson & Nathan Sobo
8f77211f04
Cursor.getBeginningOfCurrentWordBufferPosition only uses the previous 2 lines for its scan range.
...
previous: editor.9000-line-file.at-end.move-to-beginning-of-word: 4695 / 100 = 46.95ms
new: editor.9000-line-file.at-end.move-to-beginning-of-word: 1618 / 100 = 16.18ms
2012-05-09 12:24:27 -07:00
Nathan Sobo
64a91148cd
Upgrade to SpacePen 3b85ccfb0ec43, which replace 'attach' events with 'afterAttach' hooks
2012-04-26 11:37:56 -06:00
Nathan Sobo
802a4259e9
Move-to-first-character-of-line no longer explodes on empty lines
2012-04-20 18:11:01 -06:00
Corey Johnson & Nathan Sobo
d768f1a50f
Autocomplete closes when when cursor position changes
2012-04-18 17:22:52 -07:00
Nathan Sobo
f9ee35dc87
Merge branch 'master' of github.com:github/atom
...
Conflicts:
src/app/cursor.coffee
2012-04-09 14:47:55 -06:00
Nathan Sobo
cc52ff6f28
Bugfix: move-to-beginning-of-word no longer raises an error at position [0, 0]
2012-04-09 13:59:46 -06:00
Corey Johnson & Nathan Sobo
a21082395d
💄
2012-04-09 11:41:04 -07: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
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
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
Corey Johnson
bd20d34132
Only one visible cursor causes the editor to scroll
2012-04-03 15:46:28 -07:00