Commit Graph

87 Commits

Author SHA1 Message Date
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
Ben Ogle & Nathan Sobo
9083103bb3 Add click and shift-click in gutter 2014-06-19 12:04:36 -07:00
Nathan Sobo
53c363b853 Merge pull request #2615 from adnelson/feature/delete-to-end-of-line
added delete to end of line
2014-06-18 10:46:48 -06:00
Allen Nelson
ef7f0ed9ed updated docstring 2014-06-17 12:18:34 -05:00
Allen Nelson
8411d41621 deleting only selection if selection is not empty 2014-06-16 16:13:40 -05:00
Allen Nelson
fc462fcd21 added delete to end of line 2014-06-16 10:59:55 -05:00
Ivan Zuzak
588d9b97eb Unindent only if the tab is at the start of the line 2014-06-11 18:31:37 +02:00
Nathan Sobo
68ca6a0a0d Merge pull request #2532 from karlin/select-paragraphs
Adds select-to-beginning-of-next/previous-paragraph commands
2014-06-11 05:39:30 -06:00
karlin
8577bf9a4c select to beginning of next or previous paragraph commands 2014-06-06 08:37:59 -04:00
steffen
437b0decab Fix indenting of HTML (closing) tags for instance. Fix #1294
The indentation level is not anymore reduced by adding a new line,
which previously caused multiple reductions of the indentation level.
This fixes the behavior of HTML closing tags, which currently
"jump" backwards if you try to move them down.
2014-05-31 13:32:14 +02:00
Nathan Sobo
d2bc7ab192 Merge pull request #2258 from atom/ns-react-scroll-perf
Improve scroll performance of the React editor
2014-05-19 14:42:18 -06:00
Nathan Sobo
9b02055db9 Move selection background region calculation into React component 2014-05-16 15:31:13 -06:00
Nathan Sobo
0162247bd7 Precompute selection regions for all lines
This is easer to reason about and probably more efficient than computing
everything on a per-line basis.
2014-05-16 15:31:13 -06:00
Nathan Sobo
ce9fe90217 Make multi-line selections appear to span the screen with a single div
Because lines are opaque and any area of a selection that overlaps a
line is actually rendered on the line itself, the screen-spanning
background of a multi-line selection can actually be rendered as a
single div spanning the entire screen from the first row to the
penultimate row of the selection.
2014-05-16 15:31:13 -06:00
Nathan Sobo
7a9278e6a7 Render selection fragments on opaque lines
Because lines are opaque on the GPU for sub pixel antialiasing, the
lines obscure the selections which were formerly rendered behind the
lines. This commit renders selection fragments *on* each opaque line
layer so the selections look correct again. Still needs cleanup and
optimization.
2014-05-16 15:31:13 -06:00
Kirill Nikitin
917b223c6c merge conflict 2014-05-16 11:45:43 +04:00
Kirill Nikitin
111b5d1fbe 💄 Deprecate backspaceToBeginningOf{Word,Line}
Rename functions `backspaceToBeginningOfWord` to `deleteToBeginningOfWord` and
`backspaceToBeginningOfLine to `deleteToBeginningOfLine`.
Rename commands `editor:backspace-to-beginning-of-word` to
`delete-to-beginning-of-word` and `editor:backspace-to-beginning-of-line` to
`editor:delete-to-beginning-of-line`.

Fix #1791
2014-05-12 02:50:20 +04:00
abe33
b77ea04056 💄 Remove unnecessary double conditions 2014-05-12 00:06:01 +02:00
abe33
e7acbb314e 😕 Forgot to replace most references to clipboardMetadata
Never attempt to fix a PR right before going to sleep!
2014-05-09 09:33:35 +02:00
abe33
3e12695914 💄 Clear object deconstruction in Selection::copy 2014-05-09 00:07:46 +02:00
abe33
fbabc6f455 Implements multiple selections clipboard paste
Includes:

  - Passing the selection index in the `Editor::mutateSelectedText`
method callback
  - Storing all the selections content on many calls of
`Selection::copy` with `maintainClipboard = true` in a metadata
`selections` array
  - Handling clipboard with a `selections` metadata in
the`Editor::pasteText` method
2014-05-06 23:19:39 +02:00
Corey Johnson
c03dec2783 Merge remote-tracking branch 'origin/master' into cj-add-deprecation-warning-to-specs 2014-04-23 16:51:14 -07:00
Nathan Sobo
283966dbb9 Only autoscroll selections in the model when managing scroll position 2014-04-23 12:42:02 -06:00
Corey Johnson
6b833043db Removed references to the isReversed option 2014-04-22 17:51:44 -07:00
Nathan Sobo
f53d489abb Add DisplayBuffer::scrollToScreen/BufferPosition
Also add delegators in Editor and ReactEditorView
2014-04-22 17:10:23 -06:00
Nathan Sobo
a0ff6f5325 Handle 'autoscroll' option in model when setting selected buffer range 2014-04-22 17:09:45 -06:00
Nathan Sobo
48d90e3dfc Funnel cursor and selection updates through EditorComponent 2014-04-22 17:09:43 -06:00
Nathan Sobo
93388c2048 Make Cursor and Selection models for automatic id assignment 2014-04-22 17:09:43 -06:00
Nathan Sobo
3d3b72a954 Render selections 2014-04-22 17:09:04 -06:00
Corey Johnson
1583271e2f Use setTextInRange instead of change 2014-04-18 15:50:30 -07:00
Corey Johnson
3644a36d67 Clearing a selection will also finalize the selection
Fixes #1843
2014-04-11 09:44:57 -07:00
Kevin Sawicki
9fce23d5ac Update option to preserveLeadingWhitespace 2014-03-19 10:05:34 -07:00
Kevin Sawicki
8e62d772b3 Ignore leading whitespace when auto-indenting a newline
Refs atom/language-less#1
2014-03-19 10:05:34 -07:00
Nathan Sobo
99b5675c4e Ensure position is a Point in Selection::selectToPosition
Fixes #1750
2014-03-11 20:42:42 -06:00