Commit Graph

3983 Commits

Author SHA1 Message Date
Corey Johnson
8e095d7b5b Merge pull request #2164 from steffengy/fix-indent
Fix indenting of HTML tags for instance. Fix #1294
2014-06-03 12:01:44 -07:00
Corey Johnson
0f551d4b11 Add expectations to context-menu specs 2014-06-03 10:44:45 -07:00
Corey Johnson
35a7bb115d Fix context-menu specs 2014-06-03 10:44:45 -07:00
Corey Johnson
8ed3b7a250 Merge pull request #2134 from erikhakansson/AdvancedContextMenu
Advanced context menu
2014-06-03 10:13:37 -07:00
Nathan Sobo
3134bfda95 Update selections when the font size or font family change 2014-06-03 17:43:57 +09:00
Nathan Sobo
1c177aa206 Add spec for cursor position updates when the font family changes 2014-06-03 17:43:57 +09:00
Nathan Sobo
ec65def5d3 Add spec for cursor position updates when the font size changes 2014-06-03 17:43:57 +09:00
Nathan Sobo
3aefa53b33 Batch together line and character width measurement after font changes
This ensures we only perform a single update with the most up-to-date
information about line height, default character width, and specific
character widths. If this update causes more lines to be drawn we may
measure again, but not necessarily.
2014-06-03 17:43:56 +09:00
Nathan Sobo
1cc5ef3479 Update selections when the line height changes 2014-06-03 17:43:56 +09:00
Nathan Sobo
3052fe3f3b Update cursors when the line height in pixels changes 2014-06-03 17:43:56 +09:00
Nathan Sobo
1bce626324 Compute ranges of cursors & selections in EditorComponent and pass down
Previously, SelectionsComponenet::shouldComponentUpdate was storing the
ranges for selections as a side effect. We also were passing boolean
values (cursorMoved and selectionUpdated) to determine if these
components should update.

Now, we compute a simple hash of screen ranges for selections and
cursors in the root component and pass them down. This simplifies
shouldComponentUpdate for selections and allows us to implement one
for cursors.
2014-06-03 17:43:55 +09:00
Kevin Sawicki
0245ec28eb Always handle resolving absolute URIs 2014-06-02 15:45:47 -07:00
Kevin Sawicki
94f86cb461 Don't resolve uris when project has not path 2014-06-02 15:41:05 -07:00
Kevin Sawicki
b6fcc35131 Write removed file to temp directory 2014-06-02 10:17:13 -07:00
Kevin Sawicki
1704c78eea Enable core specs when run outside of clone repo
The failing specs have been updated so that specs
can now run without the requirement of a Git repository
at the root.
2014-06-02 10:17:13 -07:00
Kevin Sawicki
bcad8c1b3e Remove # which is interpreted as a tag
This spec was not running because of it since
jasmine-tagged is configured to filter tags by
process.platform
2014-06-02 10:17:13 -07:00
Kevin Sawicki
81d9193bf4 Copy repository to temp folder 2014-06-02 10:17:13 -07:00
Kevin Sawicki
7514f70434 Set project path to temp working directory 2014-06-02 10:17:13 -07:00
Kevin Sawicki
12a8688a9b Copy repository in remaining specs 2014-06-02 10:17:13 -07:00
Kevin Sawicki
0524a724e1 Move fixtures into repo 2014-06-02 10:17:13 -07:00
Kevin Sawicki
805c7ae301 💄 2014-06-02 10:17:13 -07:00
Kevin Sawicki
3f3dabed41 Remove spec completely tested in git-utils library 2014-06-02 10:17:13 -07:00
Kevin Sawicki
516035a82c Add copyRepository helper 2014-06-02 10:17:12 -07:00
Kevin Sawicki
08686ee769 Use temp directory in isPathNew/Modified specs 2014-06-02 10:17:12 -07:00
Kevin Sawicki
5b479ad5f5 Use temp directory in checkoutHead specs 2014-06-02 10:17:12 -07:00
Kevin Sawicki
d4366aa09e Pass element not jQuery object as target
Previously this was passing since ctrl-z was completely unbound at
this point which isn't the case on Windows.
2014-06-02 10:17:12 -07:00
Nathan Sobo
d31669c67f Merge EditorScrollViewComponent into Editor
I don't think that this component was really carrying its weight. Its
render function basically passed through directly to other components
that updated between renders, but didn't contain any content on its
own that actually changed after the first render.

React components seem to carry overhead, so I want every component we
use to count. Also, I'm considering circumventing some of React's
standard update logic for performance reasons, and making the structure
more shallow will help with that.
2014-06-01 15:24:59 +09: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
2548891b99 Clear the mousewheelScreenRow even if the event does not cause scrolling
If a mousewheel event is triggered when the editor can't be scrolled,
we still want to clear the mouseWheelScreenRow. This is typically done
when we stop scrolling, but if we never start scrolling it will never
happen. This commit adds another timeout to cover that case.
2014-05-31 18:36:59 +09:00
Nathan Sobo
115a7e1dfb 💄 Give mousewheel events their own describe block 2014-05-31 18:20:27 +09:00
Nathan Sobo
0043072ecf Only preserve mouseWheelScreenRow if it's out of the rendered row range
Fixes #2429, #2443

Otherwise, it's possible to duplicate lines. If a line is in the
rendered row range and it's not in the set of lines returned by the
editor, we should remove it no matter what. Line preservation is only
intended for lines that are out of view.
2014-05-31 08:56:57 +09:00
Nathan Sobo
89c57b6d52 Only set the mouseWheelScreenRow when scrolling vertically
When we handle a mousewheel event targeting a line or line number, we
assign the mousewheelScreenRow to prevent the removal of the target
node, which interferes with velocity scrolling.

However, the ::mousewheelScreenRow is only cleared 100ms after we stop
scrolling vertically. This means that if we're only scrolling
horizontally, it's never cleared. This causes the line node associated
with this screen row to hang around longer until the mousewheel screen
row is cleared again, which is not what we want.

This commit only assigns the ::mousewheelScreenRow when scrolling
vertically, so we can be sure it will be cleared.
2014-05-31 08:56:57 +09:00
probablycorey
c9ae9e11c1 Reword specs 2014-05-28 16:34:42 -07:00
probablycorey
7f57a094f6 Determine softTab state after the buffer is tokenized. 2014-05-28 16:31:00 -07:00
probablycorey
b7df08cbdd Add spec to re-emit the tokenized event when the grammar is changed 2014-05-28 16:10:02 -07:00
probablycorey
89dc5f26ad Only emit the tokenized event after the first full tokenization 2014-05-28 15:56:08 -07:00
probablycorey
2c60b0463e Use tokenized buffer created by editor 2014-05-28 15:46:26 -07:00
probablycorey
c56ac70181 Add tokenized event to tokenized buffer 2014-05-28 14:53:38 -07:00
Erik Håkansson
a90039baab fixes to spec 2014-05-24 23:52:08 +02:00
Erik Håkansson
55228f9667 updated coding style and added spec 2014-05-24 23:52:08 +02:00
Erik Håkansson
6295c2ddc4 minor changes 2014-05-24 23:52:08 +02:00
Nathan Sobo
0e31557abf Only measure character widths when editor is visible 2014-05-23 15:59:44 -06:00
Nathan Sobo
5b149bd41a Merge pull request #2370 from atom/ns-react-fix-scroll-corruption
Prevent React editor's scroll view from being auto-scrolled by Chromium
2014-05-23 12:54:15 -06:00
Corey Johnson
3784b77b95 Merge remote-tracking branch 'origin/master' into cj-paragraph-test 2014-05-23 09:23:30 -07:00
karlin
64470a3c7d add moveToBeginningOf{Next,Previous}Paragraph for cursor and wrappers for editor 2014-05-23 00:51:01 -04:00
Nathan Sobo
446a48ca00 Position hidden input at 0,0 unless cursor is focused
The editor's scroll view is getting autoscrolled when the editor is
focused, so we won't position the hidden input until after the editor
is focused, and will always return it to 0,0 when the editor is blurred.
2014-05-22 20:13:50 -06:00
Nathan Sobo
875cfefd36 Merge branch 'master' into ns-ks-react-dont-measure-when-hidden
Conflicts:
	spec/editor-component-spec.coffee
	src/editor-component.coffee
	src/editor-scroll-view-component.coffee
	src/lines-component.coffee
2014-05-22 10:48:21 -06:00
Kevin Sawicki & Nathan Sobo
481935c880 Add specs for updating lineHeightInPixels when changing font size/family 2014-05-22 10:17:22 -06:00
Kevin Sawicki & Nathan Sobo
8ffcdad89a Re-measure the line height in pixels when the CSS line-height changes 2014-05-22 10:17:21 -06:00
Kevin Sawicki & Nathan Sobo
9e3ce09658 Rename lineHeight to lineHeightInPixels to distinguish from CSS value
CSS has a line-height property with values like '1.3', but we also have
a measured pixel value for line height. It's important to keep these
separate conceptually.
2014-05-22 10:17:12 -06:00