Commit Graph

3862 Commits

Author SHA1 Message Date
Kevin Sawicki
9cf642e910 Preserve indentation when commenting
Previously this happened only when the language did not have a
comment end pattern.
2014-04-30 09:50:11 -07:00
Corey Johnson
e8c62b501f Fix workspaceView spec 2014-04-29 16:59:15 -07:00
Nathan Sobo
6ff2b2a01e Fix undefined variables in tokenized-line-spec 2014-04-29 17:24:16 -06:00
Kevin Sawicki
960285a270 Unfocus EditorComponent spec 2014-04-29 16:11:20 -07:00
Corey Johnson
fa4b3c8dea Merge pull request #1903 from atom/cj-add-deprecation-warning-to-specs
Remove all deprecated calls from core
2014-04-24 15:36:53 -07:00
Corey Johnson
c7e308bca0 Remove use of OpenSync from specs 2014-04-24 14:14:10 -07:00
Corey Johnson
bec65cf2ac Only fail on deprecations when core specs are run 2014-04-24 13:47:01 -07:00
Corey Johnson
2ceccf5239 Exclude EditorViews that are mini editors from WorkspaceView::eachEditorView
Fixes #1900
2014-04-24 09:26:04 -07: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
Corey Johnson
9d92a27ccf Remove deprecated method calls from project spec 2014-04-23 16:50:25 -07:00
Corey Johnson
b652dc8fd8 Use workspace.open instead of project.open 2014-04-23 16:36:44 -07:00
Corey Johnson
c1929540a3 Remove deprecated calls in pane view spec 2014-04-23 16:35:51 -07:00
Corey Johnson
1601423f30 Update deprecated calls in language mode spec 2014-04-23 16:31:00 -07:00
Corey Johnson
c1907054b7 Remove deprecated methods from display buffer spec 2014-04-23 16:24:10 -07:00
Corey Johnson
5f524c1181 Remove deprecated calls from git spec 2014-04-23 16:22:44 -07:00
Corey Johnson
b897603b66 Remove deprecated option from selection spec 2014-04-23 16:22:34 -07:00
Corey Johnson
0e5c530006 Remove rogue focused spec 2014-04-23 16:19:43 -07:00
Corey Johnson
4a60b5787a Remove deprecated calls from editor view spec 2014-04-23 16:18:48 -07:00
Corey Johnson
88cc69f87a Update enableKeymap spec helper 2014-04-23 16:18:36 -07:00
Nathan Sobo
1d634e471e Revert "Don't obscure the last line of the editor with the horizontal scrollbar"
This reverts commit babbdbf9e5.
2014-04-23 14:03:33 -06:00
Nathan Sobo
babbdbf9e5 Don't obscure the last line of the editor with the horizontal scrollbar
This assumes the scrollbar is 15px high, which is incorrect when using
overlay scrollbars or when the scrollbar is styled to have a different
height. We'll need to measure it in a subsequent commit.
2014-04-23 13:59:35 -06:00
Corey Johnson
38c25feee0 Remove deprecated calls to editor spec 2014-04-23 11:27:23 -07:00
Corey Johnson
b30a2c9442 Remove deprecated calls from workspace view spec 2014-04-22 16:51:50 -07:00
Corey Johnson
3eb99c9391 Remove deprecated call from spec helper 2014-04-22 16:51:38 -07:00
Corey Johnson
b5ac7c89a3 Update spec to match its description 2014-04-22 16:47:17 -07:00
Nathan Sobo
752aa9a8e9 Handle editor:page-up/down commands 2014-04-22 17:10:23 -06:00
Nathan Sobo
e4639281f8 Handle 'editor:scroll-to-cursor' command
Add Editor::scrollToCursorPosition in the model layer
2014-04-22 17:10:23 -06: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
1f768a21f0 Update absolute position of lines and line numbers when text changes
When lines are inserted or removed, we need to manually shift the
on-screen lines since everything is absolutely positioned now.
2014-04-22 17:10:22 -06:00
Nathan Sobo
22496ceeb1 WIP: Minimize paint when scrolling and composite lines with the GPU 2014-04-22 17:10:22 -06:00
Nathan Sobo
fdccc0bcc2 Measure DOM dimensions before rendering elements that depend on them
This commit breaks the initial render of the editor component into two
stages.

The first stage just renders the shell of the editor so the height,
width, line height, and default character width can be measured. Nothing
that depends on these values is rendered on the first render pass.

Once the editor component is mounted, all these values are measured and
we force another update, which fills in the lines, line numbers,
selections, etc.

We also refrain from assigning an explicit height and width on the
model if these values aren't explicitly styled in the DOM, and just
assume the editor will stretch to accommodate its contents.
2014-04-22 17:10:21 -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
dd4b6a6d28 Don't render empty selections 2014-04-22 17:09:45 -06:00
Nathan Sobo
51ee591282 Don't render cursors for non-empty selections 2014-04-22 17:09:45 -06:00
Nathan Sobo
9b6fa967be Handle the editor:consolidate-selections command in the React editor 2014-04-22 17:09:45 -06:00
Nathan Sobo
f02d956362 Preserve the only the target screen row when scrolling via mousewheel
When the target of a mousewheel event is removed, it breaks velocity
scrolling.

Previously, we were preserving the entire screen range when scrolling
with the mouse wheel, which caused a lot of DOM nodes to accumulate. Now
we only preserve the individual line and line number associated with the
target of the mousewheel event, moving them just off screen below all
the on-screen lines and line numbers. This keeps the number of DOM nodes
limited while retaining velocity effects.
2014-04-22 17:09:44 -06:00
Nathan Sobo
6607f99c6c Use padding-top/bottom rather than spacer divs in lines and gutter
It creates a simpler DOM structure.
2014-04-22 17:09:44 -06:00
Nathan Sobo
ae9f79bfc4 Only add indent guide to trailing whitespace on whitespace-only lines 2014-04-22 17:09:44 -06:00
Nathan Sobo
0d03e388f1 💄 spec description 2014-04-22 17:09:42 -06:00
Nathan Sobo
e952ab2e02 Extract a LinesComponent 2014-04-22 17:09:42 -06:00
Nathan Sobo
5c2eb053d8 Extract an EditorScrollView component 2014-04-22 17:09:42 -06:00
Nathan Sobo
f1f93f2f70 Spy on setInterval explicitly when needed in EditorComponent spec 2014-04-22 17:09:41 -06:00
Nathan Sobo
de773e4f75 Revert "Remove setInterval spy. It's now spied in the spec helper w/ setTimeout"
This reverts commit 930f1d7f018bb9949b0ee0e4ca7330a8a4ce0ec7.

I actually don't want to globally spy on setInterval because it interferes with
expected behaviors and eventually I'd like both of these to be opt-in.
2014-04-22 17:09:41 -06:00
Nathan Sobo
ca4dd5a29a Explicitly disable use of react editor in specs 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
28dd7d4acd Treat all whitespace lines as not having leading whitespace
Instead it's treated as all trailing whitespace, as it was originally.
2014-04-22 17:09:41 -06:00
Nathan Sobo
e3eb51c135 Don't expect trailing whitespace invisibles on soft-wrapped lines
Now that trailing whitespace status of tokens is assigned at
construction time, we no longer render invisibles at the end of
soft-wrapped lines. Pretty sure this is not a behavior we wanted anyway.
2014-04-22 17:09:41 -06:00
Nathan Sobo
9ec38ddb0d Remove setInterval spy. It's now spied in the spec helper w/ setTimeout 2014-04-22 17:09:41 -06:00
Nathan Sobo
7a4dc0b9a4 Eliminate duplicate key to pass coffeelint 2014-04-22 17:09:40 -06:00
Nathan Sobo
495b1571ca Add 'editor' class to ReactEditorView wrapper for backward compatibility 2014-04-22 17:09:40 -06:00