Commit Graph

158 Commits

Author SHA1 Message Date
Antonio Scandurra
b5fc710f15 Don't use atom.clipboard global in Selection 2015-10-07 15:25:05 -05:00
Nathan Sobo
32ec6b5321 🔥 Remove deprecations from Selection 2015-09-22 10:37:14 -06:00
Ivan Zuzak
7e1a295f07 Add method for cutting text to the end of the buffer line 2015-09-17 19:34:53 +02:00
Nathan Sobo
3ca11c2cef 🎨 select-line adjustments; Only select single row if row is given 2015-09-03 08:25:24 -06:00
jc roy
361ef308e2 SelectLine : When multiple line selected, complete both first and last line. 2015-09-02 20:03:18 -04:00
Nathan Sobo
698e414bfb Update selection and cursor state atomically before emitting any events
This ensures we correctly restore the last cursor when handling a cursor
destruction event. It fixes an exception that occurred when undoing
after splitting an editor.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-09-02 12:20:30 -06:00
Nathan Sobo
567199a3d2 Autoscroll the editor as a quadratic function of mouse cursor overshoot
This was a spike and still needs tests, but it’s going to be way better.
2015-08-28 12:17:59 -06:00
Nathan Sobo
12dc045329 Fix bug where word- and line-wise selections got stuck in reversed state 2015-07-29 11:49:14 -06:00
Nathan Sobo
d1dec4e0cf Don’t autoscroll to selection when double- or triple-click dragging 2015-07-28 16:16:34 -06:00
Sander van Harmelen
eaf814e5be Improve auto indenting by removing a hard coded restriction and adding a 3rd regexp
Currently there are only two regexps that can influence the indents.
Those are `increaseIndentPattern` (which tells Atom the indent of next
line should be increased) and `decreaseIndentPattern` (which tells Atom
the indent of the current line should be decreased).

But I found that a couple of languages would need a 3rd regexp in order
to support their use cases. This 3rd regexp should be a mixture of the
existing two so it tells Atom that the indent of the next line should
decrease.

I’ll add a screencast to show a use case for this 3rd regexp which I
would like to call `decreaseNextIndentPattern`.
2015-07-08 20:30:21 +02:00
Nathan Sobo
e472830063 Merge remote-tracking branch 'origin/master' into dsandstrom-add-subword-cursors-4 2015-06-30 22:55:40 -05:00
Nathan Sobo
83bddaf34e Merge branch 'master' into add-subword-cursors-4
Conflicts:
	spec/text-editor-spec.coffee
2015-06-30 15:43:33 -05:00
Nathan Sobo
82e25872b2 Handle indentation with mixed tabs and spaces 2015-06-30 15:31:11 -05:00
Nathan Sobo
b6d099ac78 Consider tabs or spaces mutually exclusively as indentation
Previously, we allowed a mix of tabs and spaces to be counted toward the
indentation of a line. This caused problems when auto-indenting lines in
a hard-tabbed file that contained “alignment spaces”, such as occurs in
aligned comment blocks. For this case, it makes more sense to assume
that the line is indented via tabs only, and consider the subsequent
alignment space as part of the line’s content. Since it’s hard to
imagine actual source code in which a mixed treatment of tabs and spaces
is desirable, I’m going with this over any more complex approach.
2015-06-29 17:05:28 -05:00
Max Brunsfeld
3cdeaa8b51 Don't auto-indent when pasting text w/ no line breaks 2015-06-17 10:57:21 -07:00
herkyl
b3687265bb Fixed 'setBufferRange' documentation parameter name 2015-06-11 10:37:38 +03:00
Lee Dohm
70a8b54e50 Delete bad merge artifacts and reword docs 2015-04-29 18:27:09 -07:00
CaptSaltyJack
a8283c3c9b Added delete-to-next/previous-word-boundary
This is better behavior for alt-del/backspace operations, is less
"greedy" and doesn't eat up excess characters.
Also set default key mappings to these, feel free to trash my changes
to keymaps/darwin.cson. Though I do feel this should be default
behavior, personally.
2015-04-29 16:31:07 -07:00
Machiste Quintana
5d2392ea67 👕 Fix new coffeelint errors 2015-04-06 23:59:54 -04:00
Kevin Sawicki
7d592c8b78 includeDeprecations -> includeDeprecatedAPIs 2015-04-03 11:29:16 -07:00
Kevin Sawicki
82c39a5af9 Use lighter Model in cursor, selection, and project 2015-04-03 11:29:15 -07:00
Kevin Sawicki
729fe91e36 Conditionally include deprecations in Selection 2015-04-03 11:29:12 -07:00
Nikolaus Wittenstein
5a3f2035a1 Replace skipAtomicTokens with clip
When clipping a screen position, callers used to have to pick between
clipping to the left edge or the right edge when the position was in the
middle of an atomic token. This change allows them to choose the closest
edge, and makes this the default.

This makes selecting hard tabs (or any other atomic tokens) work in a
similar manner as in other text editors; that is, when clicking near
the middle of a tab, the insertion point will move to the closest edge
rather than the left edge.
2015-03-29 19:43:25 -04:00
Nathan Sobo
ae4f7f6170 Explicitly autoscroll when needed
Rather than when the selection’s marker changes. This is simpler than
suppressing autoscroll via state when we don’t want it. It also captures
the intent to autoscroll when attempting to move the cursor at the
beginning or end of the document.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-03-26 16:48:24 -06:00
Nathan Sobo
99c437ccec Allow autoscroll override option in cursor/selection methods
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-03-26 16:48:21 -06:00
Nathan Sobo
10458a5b45 Always autoscroll when the range of the last selection changes
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-03-26 15:30:53 -06:00
Max Brunsfeld
2f5d975338 Remove autoscroll-related legacy editor view support
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-03-26 11:12:37 -07:00
Kevin Sawicki
590a4b0fd5 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Kevin Sawicki
fd614572f1 Deprecate all Selection::on calls 2015-03-16 16:44:52 -07:00
Nathan Sobo
010154f802 Merge pull request #5959 from atom/as-fix-select-above-below
Use screen ranges to select above and below
2015-03-16 11:26:54 -06:00
Antonio Scandurra
6633c90af8 Use buffer ranges when merging selections 2015-03-14 10:05:04 +01:00
Antonio Scandurra
0a23a21953 🎨 Get rid of goalBufferRange 2015-03-14 09:48:19 +01:00
Antonio Scandurra
8ac4848805 Skip soft-wrap indentation tokens while selecting
* 🎨 Restructure specs a bit
*  Write specs for this new behavior
2015-03-13 12:05:18 +01:00
Antonio Scandurra
f4b791d33b Use screenPosition to select above and below 2015-03-13 10:57:45 +01:00
Antonio Scandurra
2b98192276 Destroy only containing folds on selection 2015-03-11 16:16:45 +01:00
Antonio Scandurra
0970a3c411 🐎 Speed up selectAll on a buffer with many folds 2015-03-04 23:54:39 +01:00
Darrell Sandstrom
a8c4943d91 Add subword navigation
- Add commands for moving, selecting, and deleting camelCase words
2015-03-01 17:17:17 -08:00
Nathan Sobo
fc3d88aada 🐎 Auto-indent lines prior to inserting in buffer
Needs cleanup

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-12 16:21:45 -07:00
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