Commit Graph

332 Commits

Author SHA1 Message Date
Nathan Sobo
f59a8f1e68 Return function arg's result from Editor::batchUpdates 2014-04-22 17:09:45 -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
19a5269a5f Remove metaprogrammed method delegators 2014-04-22 17:09:45 -06:00
Nathan Sobo
3a42346e5e Pause cursor blink as part of the overall editor update
This ensures we don't perform two updates of the cursors component when
cursors move as part of a larger change, such as typing text.
2014-04-22 17:09:44 -06:00
Nathan Sobo
033db8997b Batch updates when moving cursors
This ensures that updates associated with autoscroll and cursor movement
get combined.
2014-04-22 17:09:43 -06:00
Nathan Sobo
ddc677fb30 Batch multiple view updates with Editor::batchUpdates 2014-04-22 17:09:43 -06:00
Nathan Sobo
48d90e3dfc Funnel cursor and selection updates through EditorComponent 2014-04-22 17:09:43 -06:00
Nathan Sobo
2517765821 Rename 'core.useNewEditor' to 'core.useReactEditor' and default to false 2014-04-22 17:09:41 -06:00
Nathan Sobo
4b9871fa13 Enable advanced scroll management only when editor is used by react view
This preserves the original behavior of the editor model with respect
to scroll position and autoscroll unless it's being used by the react
component, which flips the ::manageScrollPosition flag to true.
2014-04-22 17:09:41 -06:00
Nathan Sobo
9a3f8022ad Add shims to get bracket matcher working 2014-04-22 17:09:40 -06:00
David Graham & Nathan Sobo
6997adece9 Associate TokenizedLines with an ::indentLevel
This can be used to render the appropriate number of indent guide spans
for empty lines.
2014-04-22 17:09:39 -06:00
Nathan Sobo
81233a696b Set default horizontalScrollMargin 2014-04-22 17:09:38 -06:00
Nathan Sobo
171631d20f Autoscroll cursors horizontally at the model layer
Still need to respect the horizontal scroll position in the editor view
2014-04-22 17:09:38 -06:00
Nathan Sobo
5c9a5cdc85 Emit 'cursors-moved' from editor when one or more cursors move 2014-04-22 17:09:37 -06:00
Nathan Sobo
af9355e4e6 Add Editor::getSelectedScreenRanges 2014-04-22 17:09:37 -06:00
Nathan Sobo
3a433f734c Move the cursor on single click 2014-04-22 17:09:36 -06:00
Nathan Sobo
bad2cebd6e Add Editor::setSelectedScreenRange 2014-04-22 17:09:04 -06:00
Nathan Sobo
e472d7b038 Add autoscrolling with react editor view
Its implemented in the model to restrict touching of the DOM.
2014-04-22 17:09:04 -06:00
Nathan Sobo
08bd03b706 Opt in to editor view only when core.useNewEditor is true 2014-04-22 17:09:04 -06:00
Nathan Sobo
5a8ca1ae66 Move screen-related properties to DisplayBuffer
Scroll positions, height, width, line height. We force update when one
of these observed properties changes.
2014-04-22 17:09:03 -06:00
Nathan Sobo
53cc5c9856 Base cursor x position on char widths stored in DisplayBuffer
Whenever new lines are added to the screen, we measure and store any
unseen scope/character combinations in the DisplayBuffer.
2014-04-22 17:09:03 -06:00
Nathan Sobo
48e2302ccb Handle almost all editor commands in EditorComponent 2014-04-22 17:09:03 -06:00
Nathan Sobo
c4fdb54650 Update editor component when a visible selection is removed 2014-04-22 17:09:03 -06:00
Nathan Sobo
cc8ba2d679 Update the rendered lines when the screen lines change 2014-04-22 17:09:01 -06:00
Corey Johnson
1583271e2f Use setTextInRange instead of change 2014-04-18 15:50:30 -07:00
Kevin Sawicki
0c01de350d 📝 Shorten and tweak comment 2014-04-17 18:23:40 -07:00
Kevin Sawicki
77641f138b Make Editor::mutateSelectedText public 2014-04-17 18:23:01 -07:00
Kevin Sawicki
a967e52f68 Autoscroll when moving lines up/down
Closes #1829
2014-04-16 12:43:51 -07:00
Corey Johnson
ecfb505144 Merge pull request #1851 from atom/cj-move-functionality-to-workspace-part-II
Move functionality from Project to Workspace Part II
2014-04-15 11:45:46 -07:00
Corey Johnson
54b60a5253 Don't assume atom.workspace is always defined 2014-04-14 08:49:03 -07:00
Corey Johnson
e56fa3ec4f Use PaneContainer to keep the state of open editors 2014-04-11 11:10:00 -07:00
Kevin Sawicki
1afdd62a5d Only alter indentation when it is too low
Previously insert newline above would use the current line's
indent level which could be the less than the proper level if the
newline should be further indented based on the increase indent
pattern being used.
2014-04-11 10:07:50 -07:00
probablycorey
63a80a4d4d Revert "Revert "Merge pull request #1844 from atom/cj-move-functionality-to-workspace""
This reverts commit 87d008c337.
2014-04-08 10:52:19 -07:00
probablycorey
87d008c337 Revert "Merge pull request #1844 from atom/cj-move-functionality-to-workspace"
This reverts commit 2d7dda066c, reversing
changes made to 96e3c63291.
2014-04-08 10:44:08 -07:00
probablycorey
7685b27218 Move editor tracking to workspace 2014-04-04 15:31:20 -07:00
probablycorey
59108322e7 Merge remote-tracking branch 'origin/master' into cj-warn-deprecations
Conflicts:
	package.json
2014-04-04 14:43:54 -07:00
Kevin Sawicki
6e422d5428 Move cursor to end of line when on first row
This line may be indented now so move the cursor to the
end of the indentation.
2014-04-04 10:47:25 -07:00
Kevin Sawicki
e464c4f047 Use current indent level for newline above
Previously Editor::insertNewlineAbove would put the cursor
at position 0 if there were empty lines above the current line
regarding of the indent level of the cursor's current line.

Now the indent level of the current line is always used for the newline
above when the editor.autoIndent config is enabled.
2014-04-04 10:47:25 -07:00
probablycorey
56222a072a Add deprecation warnings 2014-04-01 16:59:16 -07:00
Kevin Sawicki
5783350484 📝 Tweak option comment 2014-03-19 10:06:10 -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
Kevin Sawicki
eba2abd5d9 📝 Doc save, saveAs, and getPath as public 2014-03-13 09:21:06 -07:00
Kevin Sawicki
86cd7f7a01 Handle non-integer indentation level values
This was already occurring when using hard tabs but soft tabs still
had issues.

Refs atom/language-c#7
2014-03-10 18:45:18 -07:00
Kevin Sawicki
86c720af81 Normalize all tabs, not just the first one
Refs atom/language-javascript#10
2014-03-10 17:57:10 -07:00
Nathan Sobo
85824c5df6 Handle last buffer line in Editor::duplicateLines 2014-03-06 14:48:52 -07:00
Nathan Sobo
20a0c27111 Rename duplicate-line to duplicate-lines (but retain deprecated method)
Might as well make the name accurate while it's early.
2014-03-06 14:36:25 -07:00
Nathan Sobo
76200884d5 Preserve folds when duplicating lines 2014-03-06 13:16:16 -07:00
Nathan Sobo
a0234d0cc6 Handle empty selections on folded lines 2014-03-06 00:07:59 -07:00
Nathan Sobo
8a77acb51e Duplicate multiple selections and multiple lines; folds are broken 2014-03-05 23:29:28 -07:00