Commit Graph

347 Commits

Author SHA1 Message Date
Antonio Scandurra
26837d65b4 Clip cursor width when soft-wrap is on and cursor is at the end of line
This prevents the parent tile from disabling sub-pixel anti-aliasing.
For some reason, adding `overflow: hidden` to the cursor container
element doesn't solve the issue, so we're adding this workaround
instead.
2018-03-13 12:04:35 +01:00
Linus Eriksson
a790f1e3ec Randomize fontSize and lineHeight in the random test
This causes the failure fixed by https://github.com/atom/atom/pull/15831
to be caught by the randomized test more easily
2018-03-05 17:24:19 +01:00
Nathan Sobo
e334f0419f Merge pull request #16753 from billyjanitsch/revert-15487
Stop scaling up small scroll wheel events
2018-02-16 11:58:33 -08:00
Linus Eriksson
63326e969a Unfocus test and always return false to see if this fails on circle 2018-02-15 22:53:29 +01:00
Linus Eriksson
ad6b2131d6 Style the scrollbar in the test 2018-02-15 22:47:33 +01:00
Linus Eriksson
3059d14bd7 Merge remote-tracking branch 'origin/master' into b3-failing-seed 2018-02-15 19:49:58 +01:00
Billy Janitsch
a433e974eb Stop scaling up small scroll wheel events 2018-02-15 10:42:57 -08:00
Wliu
7e0635d2c0 Fix spec 2018-01-26 18:41:57 -05:00
Wliu
be24e6edf7 Revert change to move mouse cursor on right-click 2018-01-24 11:22:41 -05:00
David Wilson
6d09a5257a Fix #16538: Middle-click pastes into read only editor on Linux
This change fixes an issue where users on Linux are able to paste into
read only TextEditors by clicking the middle mouse button.  The fix is
to check for whether the TextEditorComponent's isInputEnabled method
returns true before pasting with middle click on Linux.
2018-01-22 18:50:07 -08:00
Antonio Scandurra
8e74d06f64 Fix tests 2018-01-20 11:09:26 +01:00
Linus Eriksson
04507e9ee2 Use nested arrays instead of Range 2018-01-19 19:09:54 +01:00
Linus Eriksson
e07a9a6387 Merge branch 'master' of https://github.com/atom/atom into b3-failing-seed 2018-01-19 19:08:21 +01:00
Nathan Sobo
4926fe466c Move highlights container into lines for theme compatibility 2018-01-08 13:16:46 -07:00
Antonio Scandurra
69799d35b2 Delete Chrome 56 workarounds 2017-12-22 14:44:17 +01:00
Wliu
db392502e4 Always move the cursor on middle-click 2017-12-05 23:54:43 +01:00
Max Brunsfeld
e08091f193 Make assignLanguageMode take a language id instead of a language name 2017-11-28 11:14:29 -08:00
Max Brunsfeld
20bf705000 Destroy editors after text editor component specs
This only now became necessary because TokenizedBuffer now *always*
receives a reference to the Atom config on construction, and always
tries to read from it when isFoldableAtRow is called, which can happen
after test cleanup due to resize observers.
2017-11-20 11:59:21 -08:00
Max Brunsfeld
f6c2e0eba4 Allow setting the null language mode w/ assignLanguageMode(buffer, null) 2017-11-20 09:48:00 -08:00
Max Brunsfeld
3d5cc6993c Merge branch 'master' into mb-use-language-mode-api 2017-11-17 14:03:37 -08:00
Max Brunsfeld
91d4f53b28 Use assignLanguageMode in TextEditorComponent spec 2017-11-15 17:15:32 -08:00
Max Brunsfeld
653ecd7f52 Merge branch 'master' into mb-use-language-mode-api 2017-11-15 12:52:36 -08:00
Wliu
a59913f51c Update specs 2017-11-15 21:49:43 +01:00
Wliu
22d8ae67df Merge branch 'master' into b3-failing-seed 2017-11-12 13:27:28 +01:00
Linus Eriksson
9f83c4b15b And don't focus the test 2017-11-06 23:55:24 +01:00
Linus Eriksson
bea8094765 Make the tests pass 2017-11-06 23:53:55 +01:00
Max Brunsfeld
e6c3891e62 Assign a language mode in text editor component specs 2017-11-03 15:08:02 -07:00
Nathan Sobo
f25570f135 Exclude Shift from keydown events that terminate selection drags 2017-11-01 14:00:43 -06:00
Nathan Sobo
11511f27d5 Don't terminate selection dragging when a modifier key is pressed
This preserves the ability to add selections via ctrl- or cmd-click.
2017-11-01 09:22:38 -06:00
Justin Ratner
ed94726fab fix overlayComponent access syntax in test 2017-10-23 14:32:34 -06:00
Justin Ratner
089717cbd3 fix failing test 2017-10-20 15:46:27 -06:00
Linus Eriksson
612feb7cea Fix the randomized test 2017-10-19 21:46:09 +02:00
Linus Eriksson
c1c9d3f75f Handle edits that scroll up due to hiding the horizontal scrollbar 2017-10-19 21:39:59 +02:00
Antonio Scandurra
65af9e953b Stop dragging only when user interacts with keyboard
Previously, we used to prevent the user from dragging the selection
further when the buffer was about to change. This was problematic
because any change in the buffer, even one that was performed
"automatically" by a package, would cancel the dragging action and
result in a confusing experience for the user.

On the other hand, we want to prevent users from accidentally selecting
text when they perform an edit (see #15217, #15405).

This commit addresses both concerns by canceling the dragging as soon as
the user interacts with the keyboard, instead of canceling the dragging
when the buffer is about to change.

One downside of this approach is that it changes the behavior of
pressing a keystroke that does not result in a buffer change, e.g.
Shift, Arrow Keys, etc.

Signed-off-by: Jason Rudolph <jasonrudolph@github.com>
2017-10-17 18:50:20 +02:00
Antonio Scandurra
7853e3cd8c Don't throw when destroying block decorations inside marker change event 2017-10-11 09:42:53 +02:00
Linus Eriksson
43fcdf84a1 WIP 2017-10-06 22:36:53 +02:00
Antonio Scandurra
d83304cbdd Exercise more features in the randomized test
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-10-05 19:41:28 +02:00
Antonio Scandurra
ec14125ecb 🎨 2017-10-05 13:51:26 +02:00
Antonio Scandurra
ae57cd268e Delete unnecessary test code 2017-10-05 13:51:26 +02:00
Antonio Scandurra
1ca49d8f17 Move random-seed into script/package.json
...so that it doesn't get included in the final application bundle.
2017-10-05 13:51:26 +02:00
Antonio Scandurra
6e3b8cb9f8 Introduce randomized test for TextEditorComponent 2017-10-05 13:05:52 +02:00
Nathan Sobo
293b52d797 Fix rendering bug when folds hide the vertical scrollbar w/ soft wrap on 2017-10-03 11:09:44 -06:00
Max Brunsfeld
6c1356cae3 Move folding logic from LanguageMode to TokenizedBuffer
* Restate the folding logic to not *use* the TextEditor, but instead to
*return* ranges which can be folded by the editor.
* Convert the LanguageMode spec to JS
2017-09-22 12:04:51 -07:00
Wliu
1a4e6c4c85 Merge pull request #15603 from jsoref/spelling
Spelling
2017-09-10 18:29:38 +02:00
Josh Soref
5cbe7c8897 spelling: appearance 2017-09-10 15:46:38 +00:00
Antonio Scandurra
c1981ffb44 Correctly remove block decorations whose markers have been destroyed
In https://github.com/atom/atom/pull/15503 we mistakenly assumed
`marker.isValid` accounted only for the validity of the marker. However,
that method returns `false` also for markers that are valid but have
been destroyed. As a result, the editor component was mistakenly not
removing block decorations associated with such markers.

With this commit we will rely on the local `wasValid` variable instead.
If its value is `true`, it means that the block decoration has been
accounted for in the `lineTopIndex` and must, as a result, be cleaned up
in case the marker or the decoration gets destroyed.
2017-09-07 17:52:04 +02:00
Antonio Scandurra
806b652da4 Flush scroll position to dummy scrollbar components on re-attach
This prevents the dummy scrollbars from resetting their position to `0`
when the editor element is moved elsewhere in the DOM (e.g. when
splitting a pane item).
2017-09-07 15:05:42 +02:00
Antonio Scandurra
7bd2c670e1 Merge pull request #15546 from atom/as-never-autoscroll-when-clicking-on-content
Don't autoscroll when using the mouse to add, delete or move selections
2017-09-06 02:12:15 -07:00
Antonio Scandurra
20ea98ad41 Don't render block decorations located outside the visible range
Previously, when trying to use block decorations on non-empty markers,
Atom could sometimes throw an error if such markers ended or started at
a position that was not currently rendered.

In fact, even if we already restricted the decoration query to markers
that intersected the visible row range, markers that were only partially
visible would still be considered for rendering. If, depending on the
`reversed` property, we decided to render the tail or head of the marker
in question and this was outside the viewport, Atom would throw the
aforementioned exception.

This commit addresses the above issue by explicitly ignoring block
decorations that are located on rows that are not yet rendered.
2017-09-05 18:05:35 +02:00
Antonio Scandurra
91bb1e12c7 Don't autoscroll when using the mouse to add, delete or move selections 2017-09-05 15:26:54 +02:00