Corey Johnson & Nathan Sobo
1bb2531f31
Tab can auto-indent at the beginning of a line
2012-10-25 16:27:28 -06:00
Nathan Sobo
e53410b5fd
Add indentBasis metadata to pasteboard when copying text
...
This allows indent to be normalized properly even if the leading whitespace isn't copied from the first line.
2012-10-25 10:44:54 -06:00
Corey Johnson & Nathan Sobo
d3b7fbb37b
Use window.pasteboard in cut/copy/paste
2012-10-24 18:35:55 -06:00
Corey Johnson & Nathan Sobo
6f353fda62
Add indentBasis option to insertText
...
We will use this to normalize indentation on paste even when we didn't copy all the leading whitespace on the first line.
2012-10-24 18:29:09 -06:00
Nathan Sobo
ee09c20214
Merge branch 'master' into paste-indentation
2012-10-24 12:37:50 -06:00
Nathan Sobo
d1999b91ff
Base first line delta on the cursor column, not the existing line's indent
2012-10-23 16:30:38 -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
Nathan Sobo
3b18c6a42d
With autoIndent disabled, don't use suggested first line indent when normalizing
...
Also, when some lines are *less* indented than the first line, it might not be possible to outdent them as far as they originally were relative to the first line, so we do as much as possible.
2012-10-23 14:27:26 -06:00
Nathan Sobo
7bd4e8801f
If inserting on a line that is longer than the suggested indent, preserve indent
2012-10-23 14:13:51 -06:00
Nathan Sobo
0e5c76b474
Start adding the normalizeIndent option to EditSession.proto.insertText
...
This will be used by the paste command to ensure that indentation is normalized.
2012-10-23 14:07:00 -06:00
Nathan Sobo
7be3c55765
Only auto-indent when typing, not when pasting or programmatically inserting
...
This paves the way for using a different strategy to normalize indentation when pasting, without it getting tangled in auto-indent.
2012-10-23 11:59:54 -06:00
Kevin Sawicki
ab8c22825c
Support outdenting when indent is < 1 tab length
2012-10-23 09:57:39 -07:00
Corey Johnson
e2a917fcf3
Change tabText to tabLength
2012-10-18 11:31:39 -07:00
Kevin Sawicki
f2306f444a
💄
2012-10-01 15:44:58 -07:00
Kevin Sawicki
33abaff747
Don't highlight line if selection is multiline
2012-10-01 15:44:57 -07:00
Corey Johnson
f95e67d8cd
Triple click selects entire line (including \n). Fixes #44
2012-09-26 13:53:51 -07:00
Kevin Sawicki
f241bc5d2b
Delete entire region when deleting a folded line
2012-09-19 18:16:45 -07:00
Kevin Sawicki
b18627ab9b
Add delete line support bound to meta-d key
2012-09-19 15:23:10 -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
65d40557ff
InsertText takes an option to turn autoIndent off
2012-08-09 16:20:45 -07:00
Corey Johnson
cc5ee48470
Auto-outdent lines correctly
2012-08-09 13:10:37 -07:00
Corey Johnson & Nathan Sobo
e8aaec43f7
WIP: Reworking auto-indent/outdent logic
2012-08-09 12:57:47 -06:00
Corey Johnson
08a55dfcac
wip: IndentationForRow almost works TextMate preferences
2012-08-02 17:02:17 -07:00
Nathan Sobo
54616aee78
Bugfix: When the command panel makes a selection, it destroys surrounding folds
2012-07-26 10:09:28 -06:00
Nathan Sobo
a4db677979
Implement setSelectedBufferRange w/ setSelectedBufferRanges
...
Also add the preserveFolds option, which doesn't destroy folds containing the selected ranges – mainly for specs right now
2012-07-12 18:57:12 -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
3524490946
Ensure selection emits event if a buffer change moves its anchor
2012-06-29 11:55:16 -06:00
Nathan Sobo
e2efa95d13
Ensure that 'change-screen-range' events are triggered on selections by backspace
2012-06-22 16:20:50 -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
Nathan Sobo
f99ce5782c
💄
2012-06-15 16:03:54 -06:00
Corey Johnson & Nathan Sobo
4a35427db3
Delete the newline at the end of a fold only when it makes sense
2012-06-15 14:53:15 -06:00
Nathan Sobo
95622dc64e
If the cursor is at any buffer position inside a fold, backspace deletes the folded text
2012-06-15 14:41:05 -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
Corey Johnson & Nathan Sobo
f025bec910
If a selection ends on a fold, backspace/delete delete all lines inside the fold
2012-06-14 15:52:54 -06:00
Nathan Sobo
e444ba193c
Merge all ace adaptors into a single AceAdaptor class
2012-06-13 18:31:03 -06:00
Nathan Sobo
d04d4e22a2
Move autoOutdent code to LanguageMode
2012-06-13 18:08:08 -06:00
Nathan Sobo
fc72f39342
Move autoIndent code into LanguageMode
2012-06-13 16:12:51 -06:00
Nathan Sobo
09a05141d0
Remove old unused Anchor class
2012-06-13 11:06:41 -06:00
Corey Johnson & Nathan Sobo
222e12d29d
Backspace in column 0 below a fold absorbs line into fold
2012-06-12 16:49:49 -07:00
Nathan Sobo
c2c48b9b38
Move more specs to EditSession. Auto indent and soft tabs settings are delegated to edit session.
2012-06-11 17:06:40 -06:00
Nathan Sobo
2161336c78
Move logic out of CompositeSelection into EditSession
2012-06-08 17:46:14 -06:00
Nathan Sobo
873c80eaf2
Move most remaining logical methods from selection view into model
2012-06-08 15:26:54 -06:00
Nathan Sobo
31bd38dfcc
Move merging of intersecting selections into EditSession and the Selection model
2012-06-08 13:26:54 -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
f3144fe0d8
Base the screen range of the selection view on the selection model
2012-06-08 11:22:12 -06:00
Nathan Sobo
5a37a39b9b
Tie creation of SelectionViews to adding Selection models to the EditSession
2012-06-07 18:20:00 -06:00
Nathan Sobo
7cdd4d684f
Rename Selection to SelectionView in preparation for adding a Selection model
2012-06-07 17:05:14 -06:00