8880 Commits

Author SHA1 Message Date
Nathan Sobo
2602e6ec0a Merge pull request #2865 from atom/ns-react-fix-width-remeasurement
Streamline character width remeasurement to hopefully avoid exceptions
2014-07-08 14:27:26 -06:00
Nathan Sobo
1a22fc3c68 Streamline character width remeasurement to hopefully avoid exceptions
Previously, I was just remeasuring characters whenever the stylesheets
changed. I think there were situations in which the model changed, then
I remeasured characters prior to updating the view to match the model,
causing DOM exceptions. This switches the approach to only ever measure
characters after an update, ensuring the view always matches the model.
2014-07-08 14:17:39 -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
probablycorey
436d7de817 Send empty event arg 2014-07-08 11:46:04 -07:00
probablycorey
a9feed2e4a Maintain autoUpdater listeners even if the version is in dev mode.
This is so we can test the auto-updater
2014-07-08 11:41:41 -07:00
probablycorey
832aeffd4f Add basic updater spec 2014-07-08 11:12:28 -07: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
540b038ced Add is destroyed flag to decoration 2014-07-07 17:48:40 -07:00
probablycorey
44e121c997 Add autoUpdater shim for Windows 2014-07-07 17:07:42 -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
Nathan Sobo
b2c70f9e69 Move serialization of active pane from Pane to PaneContainer
Fixes #2694
Fixel #2853

Previously, we were storing an `active` boolean for each pane. We've
had some strange bugs where every pane is serializing `active: false`,
which causes exceptions when loading up the stored data.

This new approach serializes the activePaneId on the PaneContainer
itself. Since the PaneContainer is the source of truth regarding the
active pane, it makes more sense to handle it here.

This unfortunately changes the serialization version for the
PaneContainer, so people won't have their state persisted after
upgrading. But it seems better than leaving cruft to handle the old
serialization situation.
2014-07-07 16:36:10 -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
Ben Ogle
fe9fec733d Stub out Decoration::destroy and Decoration::update 2014-07-07 14:19:20 -07: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
673b62f547 Scroll React editor all the way left when soft wrap is enabled
Fixes #2842
2014-07-07 12:26:33 -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
1838ff2502 Use ‘flash’ class rather than ‘highlighted’.
Pull the flash into the base theme rather than the ui themes
2014-07-03 17:32:38 -07:00
Ben Ogle
505bfc28db fix spec 2014-07-03 17:32:37 -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
a56b5eef2f Remove the decoration update stuff 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
Ben Ogle
54039e9d3b Don’t use state. Modify the dom directly 2014-07-03 17:32:37 -07:00
Ben Ogle
92c28fc44f 💄 2014-07-03 17:32:37 -07:00
Ben Ogle
bc67efb72b 💄 Waaay less awkward 2014-07-03 17:32:37 -07:00
Ben Ogle
0ee4d864be Move flashing into the highlight component 2014-07-03 17:32:37 -07:00
Ben Ogle
1d724339d6 Don’t use attributes 2014-07-03 17:32:37 -07:00
Ben Ogle
ce90b72807 Handle the decoration + highlighted in the selection 2014-07-03 17:32:37 -07:00
Ben Ogle
4f356121d7 Handle decoration updates in the editor-component 2014-07-03 17:32:37 -07:00
Ben Ogle
7b19152a58 Add updateDecorationForMarker() 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
7202f497db Pause scroll view measurement in requestAnimationFrame helper method 2014-07-02 09:30:44 -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
Nathan Sobo
e5ab2c6507 Pause scroll view measurement when requesting animation frames
We don't want any extra DOM reading that could introduce hitches in
the animation we're running.
2014-07-02 08:47:32 -06:00
Nathan Sobo
8add5ccd7e Remove unused EditorComponent::componentWillUpdate hook 2014-07-02 08:46:56 -06:00
Ben Ogle
b0031e493e Merge pull request #2737 from atom/bo-fix-indent-guide
Fix indent guide
2014-07-01 13:46:25 -07:00
Nathan Sobo
8b57bb3309 Merge pull request #2789 from atom/ns-react-disable-gpu-option
Add editor.gpuDisabled option to prevent React editor from using layers
2014-07-01 12:48:34 -06:00
Nathan Sobo
4efabd2b5e 💄 method name 2014-07-01 12:34:00 -06:00
Nathan Sobo
18d17b55b5 Pass useHardwareAcceleration property down to CursorComponent instances 2014-07-01 12:33:45 -06:00