120 Commits

Author SHA1 Message Date
Max Brunsfeld
528267b7d7 Preserve relative indentation of pasted lines when auto-indenting 2015-01-22 08:34:20 -08:00
Max Brunsfeld
5cdeb7bc18 Fix comment for Selection::adjustIndent 2015-01-22 08:34:20 -08:00
Max Brunsfeld
825c4f6098 Remove incorrect docs for ::toggleLineCommentsForBufferRows 2014-12-30 12:36:46 -08:00
Max Brunsfeld
b374c1a11a Preserve 1st line's leading whitespace on paste 2014-11-22 09:43:23 -08:00
Max Brunsfeld
9adad17e27 📝 Doc fullLine parameter to Selection::{copy,cut} 2014-11-18 22:38:20 -08:00
Max Brunsfeld
270642b2ea Add special paste behavior when copying/cutting w/ no selection 2014-11-18 18:58:25 -08:00
Max Brunsfeld
7c43ea7a0f Restore correct indent behavior when inserting newlines
When explicitly auto-indenting and when pasting, indentation is based
on the previous non-blank line. When simply inserting newlines,
the previous line is used, even if it is blank.

Signed-off-by: Nathan Sobo <nathan@github.com>
2014-11-18 17:27:43 -08:00
Max Brunsfeld
e34eb151ca Respect 'normalizeIndentOnPaste even w/ multiple selections 2014-11-17 19:24:37 -08:00
Max Brunsfeld
ebc9a6bf51 Don't auto-indent current line when pasting after non-whitespace characters
Signed-off-by: Nathan Sobo <nathan@github.com>
2014-11-17 08:53:14 -08:00
Kevin Sawicki
f4ced3b078 Autoscroll when selecting the entire line
Closes #4032
2014-11-10 14:51:03 -08:00
Ben Ogle
5231a548e3 Pass options through to the text buffer 2014-10-30 17:49:43 -07:00
Kevin Sawicki
4889e03cf2 Always move to end of current line 2014-10-16 16:13:38 -07:00
Kevin Sawicki
7f6cc8a100 📝 Correct typos 2014-10-16 16:13:38 -07:00
Kevin Sawicki
e8e0ee1e34 📝 form -> from 2014-10-16 16:13:37 -07:00
Kevin Sawicki
afd1fa995f 💄 2014-10-16 16:13:37 -07:00
Kevin Sawicki
f94983d4d9 Scan buffer to remove trailing whitespace 2014-10-16 16:13:37 -07:00
Adam Boesch
ffa528001c Fix join lines so that only a single space will exist between two lines that are joined. 2014-10-16 16:13:37 -07:00
Ben Ogle
683d0d1b16 Editor -> TextEditor 2014-09-25 15:14:29 -07:00
Ben Ogle
688b209000 Update doc string in Selection::onDidChangeRange 2014-09-22 16:12:19 -07:00
Ben Ogle
c62fb26001 onDidChangeSelectionRange emits object with ranges + selection 2014-09-22 16:08:12 -07:00
Ben Ogle
155d4ce733 Merge pull request #3569 from atom/bo-proper-doc-marker
Rename DisplayBufferMarker to Marker
2014-09-18 16:14:35 -07:00
Kevin Sawicki
021278e902 Always auto indent at least one hard tab
Previously when the delta between the suggested and current indent level
was greater than zero but less than one, no text would be inserted since
Editor::buildIndentString returns an empty string for levels less than one
when using hard tabs.

Closes #3575
2014-09-18 15:36:31 -07:00
Ben Ogle
cef8b95ef3 Deprecate s|getAttributes for s|getProperties 2014-09-18 13:53:12 -07:00
Ben Ogle
6f2b1a4b21 Reorganize Selection into sections 2014-09-17 15:57:13 -07:00
Ben Ogle
f8b17b6b3c Add Returns line to all the event subscription methods 2014-09-10 17:07:21 -07:00
Ben Ogle
2e219f288d Add sections for docs clarity 2014-09-09 15:55:47 -07:00
Ben Ogle
e452b88fec Add sections for events 2014-09-09 12:30:43 -07:00
Ben Ogle
789d9c8eff 📝 Selection event methods 2014-09-09 10:56:44 -07:00
Ben Ogle
858ac5bf79 onDidChangeSelectionScreenRange -> onDidChangeSelectionRange
for consistency
2014-09-09 10:54:57 -07:00
Nathan Sobo
6ad9531e5c Add Selection::onDidChangeRange and ::onDidDestroy and deprecate ::on 2014-09-05 11:39:34 -07:00
Nathan Sobo
1131b33a83 Add DisplayBufferMarker::onDidChange and ::onDidDestroy 2014-09-05 11:39:33 -07:00
Ben Ogle
48b693c1c1 Add columnCounts to selection methods 2014-09-03 16:20:25 -07:00
Nathan Sobo
cfd2722348 Don’t merge adjacent non-empty selections
This improves the behavior of #3433
2014-09-02 18:10:05 -06:00
Ben Ogle
a93ef05e13 📝 Convert Selection docs 2014-08-25 15:13:45 -07:00
Maximilian Schüßler
32e59ce238 Cleanup code according to coffeelint 2014-08-14 19:41:49 +02:00
Maximilian Schüßler
381d5b91b2 Indentation respects tab stops now, fix #2672 2014-07-15 08:44:21 -07:00
Ben Ogle
eda55156e5 Merge pull request #2819 from atom/bo-decoration-api
Update the decoration API
2014-07-07 18:06:35 -07:00
Ben Ogle
e991b3d10c Move from addDecoration -> decorateMarker 2014-07-07 14:43:56 -07:00
Nathan Sobo
d042d15a50 Autoscroll to cursor on undo
Fixes #2815

This commit changes our autoscroll strategy for cursors significantly.

Originally, we were autoscrolling whenever the cursor's marker changed
positions. This worked well, except we didn't end up autoscrolling when
the user *attempted* to move the cursor to an invalid position, such as
moving down at the end of the buffer, due to the fact that the marker
wouldn't change.

Then, we moved to always requesting an autoscroll whenever a position
change was requested via Cursor::changePosition. This missed out on
moving the cursor when inserting text, so we then also added an explicit
autoscroll call when inserting text.

This had the problem of not autoscrolling due to undo. So finally, this
solution combines explicit autoscroll in ::changePosition to capture
intent, as well as implicit autoscrolling whenever the cursor's marker
position changes due to a textual change in the buffer. This captures
undo/redo correctly.
2014-07-07 15:21:48 -06:00
Ben Ogle
48b6c24882 Add Editor::selectionFlashDuration rather than magic number 2014-07-03 17:36:45 -07:00
Ben Ogle
1838ff2502 Use ‘flash’ class rather than ‘highlighted’.
Pull the flash into the base theme rather than the ui themes
2014-07-03 17:32:38 -07:00
Ben Ogle
abbe8d2eec Flash works for selections 2014-07-03 17:32:37 -07:00
Ben Ogle
80eb31679f Add a Decoration object. Rework to use this object 2014-07-03 17:32:37 -07:00
Ben Ogle
0ee4d864be Move flashing into the highlight component 2014-07-03 17:32:37 -07:00
Ben Ogle
1d724339d6 Don’t use attributes 2014-07-03 17:32:37 -07:00
Ben Ogle
ce90b72807 Handle the decoration + highlighted in the selection 2014-07-03 17:32:37 -07:00
Nathan Sobo
260be2e096 Autoscroll *after* inserting text, not before
Fixes #2787
2014-07-03 14:47:43 -06:00
Nathan Sobo
e93e4e9333 Autoscroll to the last cursor in model when inserting text
Fixes #2787
2014-07-01 11:37:17 -06:00
Ben Ogle
2eb5ef0816 Merge pull request #2665 from atom/bo-gutter-selection
Implement gutter clicking and dragging to change selection on react editor
2014-06-19 13:48:40 -07:00
Nathan Sobo
bee7be1d1a Fix errors refreshing directly after adding selection below/above 2014-06-19 13:43:10 -06:00