Commit Graph

4120 Commits

Author SHA1 Message Date
probablycorey
2bbf5c7800 Remove unnecessary spec 2014-05-20 10:37:24 -07:00
probablycorey
273203e4c9 Fix typo 2014-05-20 10:37:02 -07:00
Nathan Sobo
84e76556da Try to fix flaky spec 2014-05-20 11:11:35 -06:00
probablycorey
9b5593d020 Put EOL invisibles into their own scope 2014-05-19 17:27:59 -07:00
probablycorey
8b4cff474f Spec 💄 2014-05-19 17:10:04 -07:00
probablycorey
73ce81d597 Pass invisibles down to lines component 2014-05-19 16:56:53 -07:00
probablycorey
cbe07b49aa Add basic invisible specs 2014-05-19 16:20:51 -07: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
bfc382c398 Add specs for line/line-number preservation 2014-05-19 14:33:17 -06:00
Kevin Sawicki
314833bbac Add missing parens on indent guide check
Previously the indent guide was always showing on the whitespace only lines

Closes #2274
2014-05-19 08:52:06 -07:00
Corey Johnson
9ca506de4b Merge pull request #2173 from Locke23rus/issue-1791
💄 Deprecate backspaceToBeginningOf{Word,Line}
2014-05-16 15:13:44 -07:00
Nathan Sobo
c058483422 Update the gutter width when the number of digits changes 2014-05-16 15:56:18 -06:00
Nathan Sobo
9b7547cbe0 Get indent guide specs passing again 2014-05-16 15:31:16 -06:00
Nathan Sobo
e74dfe3438 Fix gutter specs and update lines when digit counts change 2014-05-16 15:31:16 -06:00
Nathan Sobo
b000e8e4a2 Get selection specs passing again 2014-05-16 15:31:16 -06:00
Nathan Sobo
64c82f1c87 Update cursor positioning text for simplified token markup 2014-05-16 15:31:15 -06:00
Nathan Sobo
0ad2730353 Update specs for new line node rendering approach
Lines are no longer translated on the GPU, and they aren't inserted into
the DOM in an order that reflects their order in the buffer.
2014-05-16 15:31:15 -06:00
Nathan Sobo
070d239f41 Blink cursors with a CSS animation
Now that they're on their own layer, I don't think it affects the
repaint timing when typing on lines (if it ever did).
2014-05-16 15:31:13 -06:00
Nathan Sobo
9001d34ddf Change selection specs to match new rendering scheme 2014-05-16 15:31:13 -06:00
Nathan Sobo
e44027b186 Fix the height/width of the editor in spec
Now that everything is absolutely position, the editor no longer assumes
a "natural" height and width. This can be addressed later if we want to
allow editors to expand based on their content.
2014-05-16 15:31:13 -06:00
Nathan Sobo
d53f97ecfe Fix horizontal scrolling spec 2014-05-16 15:31:13 -06:00
Nathan Sobo
f3efd7d60b Position cursors relative to scrollLeft and fix specs 2014-05-16 15:31:12 -06:00
Nathan Sobo
8d25da9474 Update line number rendering specs for new layer scheme 2014-05-16 15:31:12 -06:00
Nathan Sobo
1aee276b45 Update line rendering specs for new layer scheme 2014-05-16 15:31:12 -06:00
Nathan Sobo
3f1ce617a7 Try to fix flaky spec 2014-05-16 15:05:49 -06:00
Kirill Nikitin
8918eb4758 Bug #1791 Fix typo in example group name and function names. 2014-05-16 23:05:05 +04:00
Nathan Sobo
f2c7d171bf Fix another subscription leakage associated with theme manager specs 2014-05-16 09:14:21 -06:00
Nathan Sobo
7a4a85cb20 Fix failures running config specs locally 2014-05-16 09:00:01 -06:00
Nathan Sobo
ce668e7139 Fix subscription leak when ~/.atom/styles.less is present running specs 2014-05-16 08:33:49 -06:00
Kirill Nikitin
917b223c6c merge conflict 2014-05-16 11:45:43 +04:00
Corey Johnson
25f5717ccf Merge pull request #1971 from abe33/feature_proper_multiselections_copy_paste
Implements multiple selections clipboard paste
2014-05-12 11:10:37 -07: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
b2e86c80c4 Change test to cover all Selection::copy branches 2014-05-12 00:06:13 +02:00
Nathan Sobo
76b9982e04 Emit stylesheet-added/removed from ThemeManager w/ CSSStyleSheet objects
This enables subscribers to detect not just that stylesheets have
changed, but specifically how they have changed. This is used by the
React editor component to only refresh scrollbars when a stylesheet
that actually contains selectors for scrollbar elements is added or
removed.
2014-05-09 11:33:04 -06:00
Nathan Sobo
1c1ace90db Hide and show scrollbars before measuring them after stylesheet changes
We measure the scrollbar-corner node when there's a stylesheet change,
but Chromium won't apply the new style if it was already visible before
the change. This commit hides and shows it before measuring so we get
accurate values.
2014-05-09 11:33:04 -06:00
Nathan Sobo
bdd605e85b Explicitly assign dummy scrollbars to the correct width/height
Previously, dummy scrollbars were always 15px wide/tall. This caused
them to obscure the ability to click for the entire 15px region, even if
the actual scrollbar was styled to be much thinner. Now we explicitly
measure the size of scrollbars on mount and when the stylesheets change
and set the height/width explicitly.
2014-05-09 11:33:04 -06:00
Nathan Sobo
e1b4b921ba Hide scrollbar when not scrollable in a given direction 2014-05-09 11:33:04 -06:00
Nathan Sobo
ab1ede5fe6 Add a dummy scrollbar corner
Horizontal / vertical scrollbars render a 'corner' on the lower right
when they would otherwise overlap. I previously relied on drawing both
dummy scrollbars at their full width/height so the corner got rendered,
but that interfered with the display of the horizontal scrollbar in
certain circumstances because it was too wide to scroll. This commit
provides that behavior with an absolutely positioned div with the same
dimensions as the intersection of scrollbars when both are visible.
2014-05-09 11:33:04 -06:00
Nathan Sobo
5e6d91d66c Don't allow spec window size to interfere with the size of the editor 2014-05-09 11:33:04 -06:00
Nathan Sobo
dbd271f70a Don't obscure last character of long lines with vertical scrollbar
This entailed quite a few changes to dial in scrollbars. The scrollbars
are now adjusted in size to account for the width of the opposite
scrollbar. If the width or height are not explicitly constrained and we
are scrollable in the opposite direction that is constrained, we account
for the width of the opposite scrollbar in assigning a natural height
or width based on the content.
2014-05-09 11:33:04 -06:00
Nathan Sobo
527ada47f9 Account for gutter width in scrollWidth of horizontal scrollbar
Because the scrollbar now spans the entire editor but the scrollable
area does not include the gutter, we need to add the current width of
the gutter to the scroll width of the horizontal scrollbar to allow
it to scroll to the end of the longest lines.
2014-05-09 11:33:03 -06:00
Nathan Sobo
afb70d0a95 Remove stray return in spec 2014-05-09 11:33:03 -06:00
Nathan Sobo
b5f910ad06 Update line number padding when max digits changes 2014-05-09 11:33:03 -06:00
Nathan Sobo
7b4bc16531 Fix specs that broke when accounting for horizontal scrollbar height 2014-05-09 11:33:03 -06:00
Nathan Sobo
e6df30e94c Respect horizontal scrollbar when rendering the vertical, and vice versa
We set overflow to hidden in the opposite scroll direction only if we
can't actually scroll in that direction, causing the white square where
neither scrollbar overlaps to appear at the lower right corner.
2014-05-09 11:33:03 -06:00
Nathan Sobo
d9ba9262bf Update scrollTop to valid position when scrollbar disappears 2014-05-09 11:33:03 -06:00
Nathan Sobo
c4be32a5dd Revert "Revert "Don't obscure the last line of the editor with the horizontal scrollbar""
This reverts commit 1d634e471e.
2014-05-09 11:33:03 -06:00
abe33
ed1c8897ec 😅 Forgot to remove the test focus 2014-05-09 00:07:00 +02:00
abe33
554165ca48 💄 Harmonize lineForRow calls in specs 2014-05-09 00:02:31 +02:00
abe33
5a5cb869e2 💄 Replace have with has in spec description 2014-05-08 23:59:55 +02:00
probablycorey
6bb260140b Don't use comment lines to determine soft/hard tabs.
Closes atom/language-php#24
Closes #1733
2014-05-07 12:18:05 -07:00
abe33
56a1ecf6c1 Adds specs for multi selections clipboard handling 2014-05-07 00:13:04 +02:00
Kevin Sawicki
240747ed76 💄 Tweak spec descriptions 2014-05-05 11:28:36 -07:00
Kevin Sawicki
8b5fd64dd4 Guard against PaneAxis as first child
Pane::findLeftmostSibling expected to return a Pane, not a PaneAxis
2014-05-05 11:28:36 -07:00
Kevin Sawicki
1c514bdc6b Split right when rightmost sibling is an axis
This was previously throwing an error when Workspace::open was called
with a split: right option and the rightmost sibling was a PaneAxis
since it was assuming findOrCreateRightmostSibling was always returning
a Pane, not a PaneAxis.
2014-05-05 11:28:36 -07:00
Kevin Sawicki
27b02a7981 Add initialColumn options to Workspace::open
This options works similarly to the existing initialLine option
2014-04-30 16:07:26 -07:00
Kevin Sawicki
33c02ef3e1 Mention double clicking in spec description 2014-04-30 09:58:37 -07:00
Kevin Sawicki
aa4749f175 Select all adjacent whitespace on double click
Cursor::isSurroundedByWhitespace was use column 0 instead of the
position right before the cursor.
2014-04-30 09:58:37 -07:00
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
Nathan Sobo
59709a92ba Include SpacePen wrapper view in spec
During the transition to React, it will be easier if the EditorComponent
assumes it's rendered inside the ReactEditorView. This will make it
easier to test compatibility with existing editor APIs.
2014-04-22 17:09:40 -06:00
Nathan Sobo
022f5ca219 Replace previous character when inserting accented characters 2014-04-22 17:09:40 -06:00
Nathan Sobo
96ebb9bf03 Correctly position cursor on mousedown when editor is scrolled left 2014-04-22 17:09:40 -06:00
Nathan Sobo
95b24fb933 Position the hidden input on the most recent cursor when in view
We won't position the hidden input out of the scroll view's bounds to
prevent Chromium's autoscrolling behavior.
2014-04-22 17:09:40 -06:00
Nathan Sobo
9bdc78df2e Correctly render lines containing only whitespace 2014-04-22 17:09:40 -06:00
David Graham & Nathan Sobo
241731f9c8 Render indent guides on empty lines 2014-04-22 17:09:39 -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
David Graham & Nathan Sobo
d0a917ed14 Prevent scrollLeft/scrollTop from going out of bounds 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo
1c48f60e42 Render indent guide for react editors on non-empty lines 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo
cf27826156 Mark tokens on whitespace-only lines as having leading whitespace
This makes it easy to decide to render the indent guide for a token. If
the token has leading whitespace, we can render it.
2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo
5e38add177 Only mark trailing whitespace on the last segment of a soft-wrapped line 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo
b4af0a79d0 Mark tokens with leading/trailing whitespace when building TokenizedLine 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo
985662b8f0 Only scroll in one direction a time with the mousewheel 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo
cfdea7e73f Update the scrollLeft of the model when the horizontal scrollbar changes 2014-04-22 17:09:39 -06:00
David Graham & Nathan Sobo
48135a1e8d Update the horizontal scrollbar when scrollLeft changes in the model 2014-04-22 17:09:38 -06:00
Nathan Sobo
84bb624b5b Set x-transform of .scroll-view-content based on the model's scrollLeft 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
486a7937b5 Render • instead of line number for soft-wrapped lines 2014-04-22 17:09:38 -06:00
Nathan Sobo
1162af61ed Render a basic gutter 2014-04-22 17:09:38 -06:00
Nathan Sobo
0fd8c5441c 💄 spec organization 2014-04-22 17:09:38 -06:00
Nathan Sobo
f5551929d8 Account for half-visible lines in DisplayBuffer::getVisibleRowRange
We need to add 1 to the editor's height in lines, because it's possible
to have *partially visible* lines at the top and the bottom.
2014-04-22 17:09:38 -06:00
Nathan Sobo
4a501a7c31 Fix incorrect triple-click spec 2014-04-22 17:09:38 -06:00
Nathan Sobo
d0c61eb2be Pause cursor blinking when the cursor moves 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
2b0ef68255 Blink cursors always. Still need to pause blinking when moving. 2014-04-22 17:09:37 -06:00
Nathan Sobo
f60f9b9f4f Add 'is-focused' class to editor when hidden input is focused 2014-04-22 17:09:37 -06:00
Nathan Sobo
4f10500102 Select lines on triple-click 2014-04-22 17:09:37 -06:00
Nathan Sobo
096afcf6f3 Finalize selections on mouseup 2014-04-22 17:09:37 -06:00
Nathan Sobo
2204571ef5 Select words on double-click 2014-04-22 17:09:37 -06:00
Nathan Sobo
c4be3069f7 Select on mouse drag 2014-04-22 17:09:37 -06:00
Nathan Sobo
accee294dc Test against real mousedown events dispatched on the .lines DOM node 2014-04-22 17:09:37 -06:00
Nathan Sobo
1239ab540f 💄 spec descriptions 2014-04-22 17:09:37 -06:00
Nathan Sobo
5a0d7e716b When cmd-clicking, add a new cursor at the nearest screen position 2014-04-22 17:09:37 -06:00
Nathan Sobo
7738e74df0 When shift-clicking, select to the clicked position 2014-04-22 17:09:36 -06:00
Nathan Sobo
3a433f734c Move the cursor on single click 2014-04-22 17:09:36 -06:00
Nathan Sobo
e24196c0ef Require React directly rather than via reactionary
Reactionary is just a tiny helper library that can rely on the react
installed by the requiring application instead.
2014-04-22 17:09:36 -06:00
Nathan Sobo
57e2cf80f4 💄 Reorganize spec 2014-04-22 17:09:05 -06:00
Nathan Sobo
669586c11b 💄 2014-04-22 17:09:05 -06:00
Nathan Sobo
3d3b72a954 Render selections 2014-04-22 17:09:04 -06:00
Nathan Sobo
ab02d5f25f Update the vertical scroll bar when scrollTop changes in the model 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
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
148a9f0248 Add DisplayBuffer::pixelPositionForScreenPosition
This bakes character width tracking into display buffer directly, which
moves us toward a world where all rendering decisions can be made in the
model to strictly control DOM reads.
2014-04-22 17:09:03 -06:00
Nathan Sobo
6327094696 Transfer focus from editor component to its hidden input 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
e365e51a2b Render all visible cursors 2014-04-22 17:09:03 -06:00
Nathan Sobo
70e5880b1d Start on cursor rendering 2014-04-22 17:09:02 -06:00
Nathan Sobo
2dda577d7c Improve TokenizedLine::getScopeTree specs and fix bug 2014-04-22 17:09:02 -06:00
Nathan Sobo
958bc638d7 Improve scrolling performance 2014-04-22 17:09:02 -06:00
Nathan Sobo
a134a60ce8 Render the entire editor with React. Handle vertical scrolling.
The space-pen view is now a simple wrapper around the entire React
component to integrate it cleanly into our existing system. React
components can't adopt existing DOM nodes, otherwise I would just have
the react component take over the entire view instead of wrapping.
2014-04-22 17:09:02 -06:00
Nathan Sobo
8ad13d3045 Add a real spec for visible line rendering in the react editor view 2014-04-22 17:09:01 -06:00
Nathan Sobo
da36d5f40f Start experimenting with an EditorView that renders content with React 2014-04-22 17:09:01 -06:00
Corey Johnson
3bd7bfcbf1 Merge remote-tracking branch 'origin/master' into cj-add-deprecation-warning-to-specs 2014-04-22 16:06:04 -07:00
Corey Johnson
3e94c0be22 Remove deprecated methods from window spec 2014-04-22 14:19:13 -07:00
Corey Johnson
db0cce6234 Remove focused spec 2014-04-22 14:19:01 -07:00
Corey Johnson
81df4ed238 Change Workspace::reopenItemSync to use promises 2014-04-22 14:15:07 -07:00
Corey Johnson
7b756ec3f3 Remove calls to openSync from the workspace-spec 2014-04-22 11:24:27 -07:00
Corey Johnson
0d95718d1f Remove focused spec 2014-04-22 11:04:14 -07:00
Corey Johnson
1da23e8d04 Remove deprecations from atom-spec 2014-04-22 11:01:21 -07:00
Corey Johnson
43792d019a Output deprecation message 2014-04-22 11:01:05 -07:00
Corey Johnson
ec0b4a2dc6 Move deprecation output to its own function 2014-04-22 10:44:25 -07:00
Corey Johnson
1083136dec Don't allow specs that call deprecated methods to pass 2014-04-22 10:11:52 -07:00
Corey Johnson
e450e61248 Fix broken spec 2014-04-22 10:01:24 -07:00
Corey Johnson
fd7951b2c6 Remove focused spec 2014-04-22 09:51:15 -07:00
Corey Johnson
1583271e2f Use setTextInRange instead of change 2014-04-18 15:50:30 -07:00
Corey Johnson
da49751f24 Remove usage of PaneContainerView::getActivePaneView 2014-04-18 10:43:27 -07:00
Kevin Sawicki
81646532b4 Ignore non-string core.themes config entries
Previously exceptions would be raised downstream if invalid theme
names were returned from ThemeManager::getEnabledThemeNames

Closes #1877
2014-04-17 13:33:51 -07:00
Kevin Sawicki
408665d7d2 Add Config::isDefault(keyPath) 2014-04-17 13:24:34 -07:00
Kevin Sawicki
541ffa5057 💄 Combine specs 2014-04-17 13:24:34 -07:00
Kevin Sawicki
0ea683e0b5 💄 Move expect up one line 2014-04-17 13:24:34 -07:00
Kevin Sawicki
f12004d27b Add object to default value spec 2014-04-17 13:24:34 -07:00
Kevin Sawicki
35d268fcf8 Use _.isEqual when comparing value to default 2014-04-17 13:24:34 -07:00
Kevin Sawicki
20c3ca21e3 Add Config::getDefault(keyPath) 2014-04-17 13:24:34 -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
6dfbd5733d Fix spec 2014-04-11 11:14:46 -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
Corey Johnson
d47e8fc583 Fix indentation error 2014-04-11 09:45:54 -07:00
Corey Johnson
3644a36d67 Clearing a selection will also finalize the selection
Fixes #1843
2014-04-11 09:44:57 -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
a79885eafb Add 'the' 2014-04-07 15:43:53 -07:00
probablycorey
11a91fb974 Move editor-created specs to Workspace 2014-04-04 15:31:44 -07:00
probablycorey
1d426e8fd2 Move editor-created event to Workspace 2014-04-04 15:31:44 -07:00
probablycorey
6f0094e6ce Move editor removal specs to Workspace 2014-04-04 15:31:44 -07:00
probablycorey
915cad39e8 Set atom.workspace in Workspace spec 2014-04-04 15:31:44 -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
Kevin Sawicki
cebb27154d Merge pull request #1837 from atom/ks-comment-line-with-only-whitespace
Use cursor indent level if commenting single line
2014-04-04 09:30:05 -07:00
Kevin Sawicki
afe6685ce8 Merge pull request #1833 from atom/ks-backspace-on-first-line
Allow backspace to beginning of word on first line
2014-04-04 09:28:51 -07:00
Kevin Sawicki
1aa64a9d80 Use cursor indent level if commenting single line
Previously commenting a line of all whitespace would insert
the comment at column 0 on the line since blank lines are
ignored when calculating the minimum indent level.
2014-04-03 18:26:50 -07:00
Kevin Sawicki
3e24d045e5 Allow backspace to beginning of word on first line
Previously this would fail when only whitespace was to the
left of the cursor.
2014-04-03 12:04:22 -07:00
Kevin Sawicki
f153cbb41f Don't call Config::save when setting defaults
Instead just emit an updated event, saving is not needed
because only the defaults are changing.
2014-04-03 11:00:45 -07:00
Corey Johnson
d47cc6fa0b Remove explicit atom.workspace.destroy call 2014-04-02 14:36:32 -07:00
Corey Johnson
784d22368e Remove unneeded ? 2014-04-02 14:19:06 -07:00
Corey Johnson
4165a69fed Change destroy order 2014-04-02 14:02:21 -07:00
Corey Johnson
61ae185494 Create workspace after project 2014-04-02 13:23:50 -07:00
Corey Johnson
0c12f712c9 Add atom.workspace to every spec
We add project to every spec, I'd like to add workspace so that we can
move all the opener logic to workspace.
2014-04-02 12:03:01 -07:00
Nathan Sobo
70cd6a6bc3 💄 Use CoffeeScript :: notation in specs
Going to add another spec on a branch and prefer to stick with our new
convention.
2014-04-02 07:58:48 -06:00
Nathan Sobo
6e9217be5f Reenable disable display-buffer-marker specs 2014-04-02 07:50:24 -06:00
Nathan Sobo
65564e2012 Rename atom.keymap to atom.keymaps 2014-03-31 16:28:55 -06:00
Nathan Sobo
d612a71af5 Upgrade to atom-keymap@0.14.0 and account for renamed methods 2014-03-31 16:01:31 -06:00
Kevin Sawicki
940145be7a Add spec for Git::getDirectoryStatus 2014-03-28 14:01:21 -07:00
Kevin Sawicki
c3a1831959 Use Git::getCachedPathStatus in spec 2014-03-28 13:34:21 -07:00
Corey Johnson
aa02bc1aaf Remove window.debugContent
Whoops!
2014-03-26 14:16:24 -07:00
Corey Johnson
c46238f795 Add spec 2014-03-26 13:57:12 -07:00
Justin Palmer
c389bccfa0 update editor view specs to account for lineHeight 2014-03-24 11:37:58 -07:00
Nathan Sobo
bd68790a10 Cleanup stylesheets added during spec in afterEach 2014-03-19 21:51:08 -06:00
Nathan Sobo
f0a7663447 Recalculate line-height and char-width when stylesheets change
If either of these dimensions change, we request a display update for
the editor.
2014-03-19 21:37:26 -06:00
Nathan Sobo
2d26382510 Emit 'stylesheet-changed' from atom.themes
Whenever stylesheets are applied or removed.
2014-03-19 15:51:36 -06:00
Kevin Sawicki
7c17c99b9e Update spec description 2014-03-19 10:05:34 -07:00
Kevin Sawicki
ff560bc3a3 Update spec to not be before whitespace 2014-03-19 10:05:34 -07:00
Kevin Sawicki
2e8c0234bb Tweak spec description 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
Cheng Zhao
6838ff8ea2 Merge pull request #1762 from atom/linux-build
Make Atom build on Linux
2014-03-19 01:40:11 +00:00
Kevin Sawicki
8aa2c40bbf Don't capture whitespace group in comment patterns
This was causing corruption when uncommenting XML since the fact that
it was being captured was throwing off the index used into the match.

Closes atom/language-xml#3
2014-03-18 18:19:59 -07:00
Cheng Zhao
f2e5b480e1 Fix specs on Mac. 2014-03-18 16:32:34 +08:00
Cheng Zhao
8bf1464b64 Fix setting NODE_PATH in specs window. 2014-03-18 15:57:16 +08:00
Nathan Sobo
b26e0d42d5 Merge branch 'master' into ns-extract-keymap 2014-03-17 22:28:14 -06:00
Nathan Sobo
8ee4e927a1 Unspy setTimeout in an attempt to fix flaky spec 2014-03-17 22:27:26 -06:00
Nathan Sobo
3d28f957c7 Export Keymap from keymap-extensions 2014-03-17 13:05:47 -06:00
Nathan Sobo
8f2745c248 Remove old keymap-spec. It has been supplanted by the atom-keymap npm 2014-03-17 13:05:46 -06:00
Nathan Sobo
1c964d05f8 💄 spec helper's keydownEvent 2014-03-17 13:05:46 -06:00
Nathan Sobo
2dcbf7f751 Replace Keymap subclass with keymap-extensions 2014-03-17 13:05:46 -06:00
Nathan Sobo
067f73da38 Defend against jQuery-wrapped targets in keydownEvent spec helper 2014-03-17 13:05:46 -06:00
Nathan Sobo
8974cb5f34 Make a quick and dirty subclass of the Keymap from the npm 2014-03-17 13:05:46 -06:00
Kevin Sawicki
37d67e8a83 Add spec for dragging with editor hidden 2014-03-13 10:56:31 -07:00
Kevin Sawicki
2f8e67d679 Add event.which to 1 in more specs 2014-03-13 10:49:34 -07:00
Kevin Sawicki
22dc165a25 Set event.which to 1 in specs 2014-03-13 10:47:03 -07:00
Kevin Sawicki
864ab0c095 Use file path in save as dialog
Previously the dirname of the file path was used which caused the
save dialog to not be filled in with the current file name

Closes #1748
2014-03-12 18:41:50 -07:00
Kevin Sawicki
68c2c18d83 Don't allow the tab length to go below 1
Closes #1751
2014-03-12 18:00:11 -07:00
Kevin Sawicki
8cb66895f0 Check that activations events are present
Having an empty array, object, or string will now be treated
as no activation events.

This was reported as being confusing since people were just clearing
the array generated by the package generator but their packages weren't
activating.
2014-03-11 16:15:30 -07:00
Kevin Sawicki
d6433a67c8 Incluse JavaScript specs when loading suite
Closes #1615
2014-03-11 13:01:28 -07:00
probablycorey
945011f9e3 Add data to the same jquery object that is appended to the list.
Closes #1747
2014-03-11 11:20:03 -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
a79090c65a Unfocus spec 2014-03-10 18:43:38 -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
4acfe11af1 Remove previous duplicate-line specs from editor-view-spec 2014-03-06 14:49:20 -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
ce4ce55b29 Make outermostFoldsForBufferRowRange exclusive of end row 2014-03-06 12:52:27 -07:00
Nathan Sobo
d97a0a3324 Add DisplayBuffer::outermostFoldsInBufferRowRange 2014-03-06 12:36:42 -07:00
Nathan Sobo
aff37d1ae4 WIP: Add failing spec for duplicating folds when duplicating lines 2014-03-06 00:29:35 -07:00