Commit Graph

4249 Commits

Author SHA1 Message Date
Nathan Sobo
635f288050 Explicitly assign height of editor-contents when height is auto 2014-07-21 10:43:30 -07:00
Nathan Sobo
cc8b7b13b3 Don't show the gutter when 'mini' is true on React editors 2014-07-21 10:43:30 -07:00
Nathan Sobo
e999ef00e7 Base editor dimensions on the wrapper view
The goal is to make the editor behave like a standard block-level
element.

The horizontal behavior is simple: we stretch horizontally to fill our
container.

The vertical behavior is more nuanced. If an explicit height is assigned
on the wrapper view, we honor that height. But if no explicit height is
assigned, the editor stretches vertically so that its contents are
visible.

This prepares us to support mini editors, which need to be 1-line tall
without an explicit height assignment.
2014-07-21 10:43:30 -07:00
Nathan Sobo
f16ea63a95 Export ReactEditorView as EditorView from 'atom' module
Also, remove a few early requires of 'exports/atom.coffee' in the spec
suite that were causing failures.
2014-07-21 10:43:30 -07:00
Nathan Sobo
cdb5fe15d2 Render nbsp on empty lines to ensure they have a non-zero height
Fixes #2958
2014-07-16 00:56:14 -07:00
Ivan Žužak
608c2b5354 Merge pull request #2977 from atom/iz-multiple-separators
Support multiple separators in context menu
2014-07-15 15:22:37 -07:00
Ben Ogle
cce49da18c Fix spec 2014-07-15 08:44:58 -07:00
Ben Ogle
29e883cf36 Add specs 2014-07-15 08:44:21 -07:00
Ivan Zuzak
cd1a17fb0a Support multiple separators in context menu 2014-07-14 17:10:13 -07:00
Lee Dohm
b100310764 Add failing test for #2274
Tested first on a branch off of `master` to ensure that it would
actually fail 😀
2014-07-13 13:27:32 -07:00
Ben Ogle
e620121953 Add spec for loading theme with incomplete variable file 2014-07-11 14:04:54 -07:00
Ben Ogle
9976166902 Render the line numbers after gutter mount
Fixes #2916
2014-07-10 17:25:58 -07:00
Nathan Sobo
7155ec4b73 Fix autoscroll specs for addSelectionForBufferRange 2014-07-09 08:06:14 -06:00
Nathan Sobo
e170b9f56b Render line-ending invisibles on empty lines
Fixes #2857

Including correct interleaving with indent guides.
2014-07-08 16:53:06 -06:00
Corey Johnson
57ed190ea3 Merge pull request #2859 from atom/cj-windows-updater
Add autoUpdater shim for Windows
2014-07-08 12:52:45 -07:00
Ben Ogle
2b957beeda 💄 Fix ugly test 2014-07-08 11:18:47 -07:00
probablycorey
832aeffd4f Add basic updater spec 2014-07-08 11:12:28 -07:00
Kevin Sawicki
5d08ecdcb2 Remove logging in specs 2014-07-08 10:57:22 -07:00
Nathan Sobo
997529774c Clean up after stylesheet applications in editor-component-spec 2014-07-08 11:55:50 -06:00
Nathan Sobo
48d20ff1ec Only remeasure char widths on stylesheet changes if editor is visible
Fixes #2856
2014-07-08 11:46:23 -06:00
Ben Ogle
eda55156e5 Merge pull request #2819 from atom/bo-decoration-api
Update the decoration API
2014-07-07 18:06:35 -07:00
Ben Ogle
ce1ebec253 Fix specs 2014-07-07 17:48:24 -07:00
Nathan Sobo
2878196e0a Make React editor indent guide work like it did in the old editor
Fixes #2367

* The indent level of empty lines is the *max* of the nearest non empty
  line, rather than favoring the level of the line below.

* An extra wrap guide is no longer rendered for empty lines

I didn't port the specs over because we already had good coverage at the
model level. It just needed to be updated for the preferred behavior.
2014-07-07 17:59:26 -06:00
Ben Ogle
d7a3ffa9de Handle Decoration::update 2014-07-07 15:13:04 -07:00
Nathan Sobo
18ed91a402 Merge pull request #2852 from atom/ns-react-remeasure-characters-on-stylesheet-change
Re-measure character widths when stylesheets change
2014-07-07 15:47:29 -06:00
Ben Ogle
e991b3d10c Move from addDecoration -> decorateMarker 2014-07-07 14:43:56 -07:00
Nathan Sobo
e1e510e473 Re-measure character widths when stylesheets change
Fixes #2845
2014-07-07 15:39:00 -06:00
Nathan Sobo
d042d15a50 Autoscroll to cursor on undo
Fixes #2815

This commit changes our autoscroll strategy for cursors significantly.

Originally, we were autoscrolling whenever the cursor's marker changed
positions. This worked well, except we didn't end up autoscrolling when
the user *attempted* to move the cursor to an invalid position, such as
moving down at the end of the buffer, due to the fact that the marker
wouldn't change.

Then, we moved to always requesting an autoscroll whenever a position
change was requested via Cursor::changePosition. This missed out on
moving the cursor when inserting text, so we then also added an explicit
autoscroll call when inserting text.

This had the problem of not autoscrolling due to undo. So finally, this
solution combines explicit autoscroll in ::changePosition to capture
intent, as well as implicit autoscrolling whenever the cursor's marker
position changes due to a textual change in the buffer. This captures
undo/redo correctly.
2014-07-07 15:21:48 -06:00
Nathan Sobo
fad2a63a14 Account for padding-left on the scroll view when soft-wrapping lines
Fixes #2844
2014-07-07 14:02:24 -06:00
Nathan Sobo
2de42303d4 💄 2014-07-07 13:55:32 -06:00
Nathan Sobo
673b62f547 Scroll React editor all the way left when soft wrap is enabled
Fixes #2842
2014-07-07 12:26:33 -06:00
Kevin Sawicki
0aa5fa9eeb Increase timeout on Windows CI 2014-07-07 10:14:38 -07:00
Kevin Sawicki
2e554ac819 Use cross platform path in Project::replace spec 2014-07-05 10:01:19 -07:00
Nathan Sobo
7ac8b80172 Explicitly test removal of flash class prior to next animation frame 2014-07-04 09:56:51 -06:00
Ben Ogle
48b6c24882 Add Editor::selectionFlashDuration rather than magic number 2014-07-03 17:36:45 -07:00
Ben Ogle
e5f800ef35 💄 2014-07-03 17:32:38 -07:00
Ben Ogle
492022fdd8 Fix spec 2014-07-03 17:32:38 -07:00
Ben Ogle
abbe8d2eec Flash works for selections 2014-07-03 17:32:37 -07:00
Ben Ogle
bf33d96899 Decorations can be flashed 2014-07-03 17:32:37 -07:00
Ben Ogle
80eb31679f Add a Decoration object. Rework to use this object 2014-07-03 17:32:37 -07:00
Nathan Sobo
c2b7955ec6 Adjust DisplayBuffer::longestScreenRow when lines are inserted/removed
Fixes #2810

The line corresponding to the longest screen row moves when lines are
inserted or removed above it, so we need to adjust it accordingly or we
won't always realize when a change affects the longest line.
2014-07-03 16:15:49 -06:00
Nathan Sobo
9ece33dbfe Handle double and triple click with command key held down
Fixes #2812
2014-07-03 15:18:53 -06:00
Nathan Sobo
260be2e096 Autoscroll *after* inserting text, not before
Fixes #2787
2014-07-03 14:47:43 -06:00
Nathan Sobo
a4ed02c3c5 Update lines for line insertions/removals preceding rendered row range 2014-07-03 11:22:57 -06:00
Nathan Sobo
66319ca9c0 Merge pull request #2801 from atom/ns-react-fix-jitter
Fix jitter in React editor
2014-07-02 10:34:01 -06:00
Nathan Sobo
17fa580ecd Ignore 'scroll' events when an update is pending
This prevents feedback loops where we handle stale 'scroll' events
for scrolls requested in the model layer. It prevents jitter when
autoscrolling with the cursor.
2014-07-02 10:11:35 -06:00
Nathan Sobo
9508909a9f Don't defer updates with setImmediate in animation frames
I previously thought this was okay, but now I'm experiencing jitter when
scrolling with the trackpad when updates are deferred, and the frames
seem jagged. So this commit restores a synchronous approach to display
updates whenever we use animation frames.
2014-07-02 09:26:24 -06:00
Ben Ogle
1fa6661efd Remove the awkward _.pick 2014-07-01 11:48:36 -07:00
Ben Ogle
dcb0d9b039 Update editor component specs 2014-07-01 11:41:44 -07:00
Ben Ogle
718e1228bd Add checks for the change event 2014-07-01 11:32:04 -07:00
Ben Ogle
3e57fb8e9a 💄 naming 2014-07-01 10:59:42 -07:00
Ben Ogle
de0e945c5c More specs in tokenized buffer testing empty line retokenizing 2014-07-01 10:54:37 -07:00
Ben Ogle
65c2f26656 Little note 📝 2014-07-01 10:54:36 -07:00
Ben Ogle
8ca709eb6a Fix spec name 2014-07-01 10:54:36 -07:00
Ben Ogle
43e88f6515 Invalidate whitespace lines when their indent level changes
Refs #2376
2014-07-01 10:54:36 -07:00
Ben Ogle
d97eacc2f9 Add isOnlyWhitespace() 2014-07-01 10:54:36 -07:00
Ben Ogle
06d06d10e0 💄 2014-07-01 10:45:13 -07:00
Ben Ogle
44b95fc637 Emit errors from the out of process searches 2014-07-01 10:44:30 -07:00
Nathan Sobo
e93e4e9333 Autoscroll to the last cursor in model when inserting text
Fixes #2787
2014-07-01 11:37:17 -06:00
Nathan Sobo
d4a7bff525 Merge pull request #2608 from philschatz/ps-dedupe-context-menu
remove duplicate context menu entries
2014-07-01 11:08:18 -06:00
Nathan Sobo
a99bde4e2d Reassign scrollTop if deleting lines decreases the max scrollTop
Fixes #2725
2014-07-01 09:01:04 -06:00
Nathan Sobo
15ca3e2a40 Match existing editor's behavior for .cursor-line class 2014-06-28 15:39:22 +01:00
Nathan Sobo
ea9f5eb1c7 💄 Unify specs for all line decorations 2014-06-28 15:39:22 +01:00
Nathan Sobo
7f70b41696 Update the specs for .cursor/selection-line decorations 2014-06-28 15:39:22 +01:00
Nathan Sobo
bd238d6885 Add specs for gutter decoration options
- onlyHead
- onlyEmpty
- onlyNonEmpty
2014-06-28 15:39:22 +01:00
Nathan Sobo
fa7e388352 Add 'onlyEmpty' and 'onlyNonEmpty' decoration options 2014-06-28 15:39:21 +01:00
Nathan Sobo
a2b90cd501 Add 'onlyHead' option for decorations
It only decorates the head position of the decoration's marker.
2014-06-28 15:39:21 +01:00
Nathan Sobo
71fb063a67 Un-f 2014-06-28 15:24:24 +01:00
probablycorey
e7aef25f1f Update tokenized buffer specs 2014-06-27 10:18:04 -07:00
probablycorey
071b391994 Describe surrogate pair as UTF-8 surrogate pair 2014-06-27 10:17:28 -07:00
Ben Ogle
7179bc5af1 Merge pull request #2738 from atom/bo-fix-max-scroll-width
Fix max scroll width in react editor
2014-06-25 18:16:32 -07:00
Nathan Sobo
3bf0c73170 Assign line width explicitly to prevent full screen repaints
Fixes #2746
2014-06-25 19:13:50 -06:00
Nathan Sobo
eb84737109 Fix specs for use of setImmediate instead of nextTick in requestUpdate 2014-06-25 18:38:06 -06:00
Nathan Sobo
63e8099088 Allow successive accented characters to be inserted in React editor
Refs #2732

Because we're only checking the length of the input element's selection
in the React editor on textinput events and not also its content, we
were mistaking some IME compositions as accented character menu
insertions. Clearing the content of the input on 'compositionend'
prevents this issue.
2014-06-25 18:19:53 -06:00
Ben Ogle & Nathan Sobo
f739dce210 Only recompute scroll width once for each batch of measured chars 2014-06-25 15:26:13 -07:00
Ben Ogle & Nathan Sobo
77389b0518 Update scrollWidth when the max line length / default char width changes 2014-06-25 15:26:13 -07:00
Ben Ogle
196f64d846 Fix specs 2014-06-25 15:26:13 -07:00
Ben Ogle
b7d8e581ee Merge pull request #2727 from atom/bo-subscribe-to-marker-changes
Subscribe to marker changes
2014-06-24 11:15:47 -07:00
Ben Ogle
396b21bc04 Fix specs failures caused by making lines 100% width 2014-06-24 10:32:48 -06:00
Kevin Sawicki
1c2e997415 Merge pull request #2700 from atom/bo-grammar-preload
Preload grammars on deserialization
2014-06-24 08:26:57 -07:00
Kevin Sawicki
148b691734 Test grammars included across multiple packages 2014-06-24 08:14:11 -07:00
Ben Ogle
ccada33d57 Remove nextTick in spec 2014-06-23 22:27:40 -06:00
Ben Ogle
1d9514ca81 Don't call nextTick within requestAnimationFrame
This seems to be causing stutter when scrolling on the GPU. When I don't
use nextTick when requesting animation frames, the problem seems to go
away. Maybe there's some issue with the integration between the Node
and Chromium event loops plus sending things to the compositor.

/cc @benogle
2014-06-23 22:21:28 -06:00
Kevin Sawicki
2e424baf2a Use correct expected call count 2014-06-23 17:41:33 -07:00
Kevin Sawicki
0547d5a78b Assert grammars are sync loaded on deserialize 2014-06-23 17:36:14 -07:00
Kevin Sawicki
0a54233ef0 Merge branch 'master' into bo-grammar-preload 2014-06-23 17:05:48 -07:00
Kevin Sawicki
e11785ce98 Serialize packages names in Workspace 2014-06-23 16:56:46 -07:00
Kevin Sawicki
b1d7de8d43 Add spec for serializing active grammars 2014-06-23 16:41:46 -07:00
Ben Ogle
f381abcbad Re-render when a marker changes
fixes #2705
2014-06-23 16:00:36 -07:00
Ben Ogle
7139fd9f98 Conditionally render the gutter for the showLineNumbers option
Fixes #2707
2014-06-23 15:22:16 -07:00
Nathan Sobo
b9a3eca091 Correcly handle folds that end where other folds begin
Fixes #2247
2014-06-23 11:29:14 -06:00
probablycorey
9a5da3c27e Add next tick call 2014-06-23 09:13:39 -07:00
probablycorey
43cb9af4a4 Add editor-event spec 2014-06-23 08:51:17 -07:00
Nathan Sobo
7c356d2592 Revert "Render highlights on their own layer to avoid GPU artifacts" 2014-06-21 01:58:11 -06:00
Nathan Sobo
e49414d2ec Merge pull request #2699 from atom/ns-react-fix-artifacts
Render highlights on their own layer to avoid GPU artifacts
2014-06-20 17:03:26 -06:00
Nathan Sobo
e084bebb54 Autoscroll to selections in model layer when added
Fixes #2698
2014-06-20 16:53:46 -06:00
Nathan Sobo
d839ea9aa5 Don't render an opaque background behind line numbers
It doesn't help subpixel anti-aliasing like I thought, so screw it.
2014-06-20 16:07:19 -06:00
Nathan Sobo
68d0a99c6e Default EditorComponent to updating synchronously in specs
This commit adds a static property, EditorComponent.performSyncUpdates,
which can be used to control the update behavior of all editor
components. In addition, an instance property called performSyncUpdates
be assigned to control the update behavior of a specific instance.
2014-06-20 15:06:16 -06:00
Nathan Sobo
64f3938f5c Batch all editor updates together automatically via process.nextTick 2014-06-20 15:06:10 -06:00
Kevin Sawicki
4136ff566b 📝 Correct spec description 2014-06-20 13:09:51 -07:00