Nathan Sobo
8435e0176b
Add selection-line class to old editor gutter for forward-compatibility
...
The React editor does not apply the .cursor-line-no-selection class,
but instead relies on a combination of .cursor-line and .selection-line
for selectors that want to target the cursor line when there is no
selection.
This allows themes to be upgraded to support the React editor and the
old editor at the same time.
2014-06-28 15:39:21 +01:00
Nathan Sobo
f5e54b0ba6
Only add 'selection-line' decoration when marker is non-empty
2014-06-28 15:39:21 +01:00
Nathan Sobo
fa7e388352
Add 'onlyEmpty' and 'onlyNonEmpty' decoration options
2014-06-28 15:39:21 +01:00
Nathan Sobo
70f352251e
Only apply cursor-line decoration to head; Add selected-line decoration.
...
The cursor-line decoration shouldn't be applied to every line that's
selected. It should only be applied to the location of the cursor. We'll
need to update themes to reflect this.
2014-06-28 15:39:21 +01:00
Nathan Sobo
1b05708d7a
Update addDecorationForMarker docs to talk about 'onlyHead' option
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
b376bd8688
Fix scrollbar dragging in React editor
...
Fixes #2751
2014-06-28 11:33:41 +01: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
2b54c9bebe
Use setImmediate to batch all editor updates, even in animation frames
...
When I was using nextTick to batch updates, there were issues with
flicker. So I was attempting to always update synchronously in animation
frames, which was complicated. setImmediate doesn't cause the flicker
however, so I'm able to remove the special logic for sync updates in
animation frames and just use it across the board.
2014-06-25 18:20:49 -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
809804d0cc
💄
2014-06-25 15:26:13 -07:00
Ben Ogle
8054b769d6
Default scrollWidth to 0
2014-06-25 15:26:13 -07:00
Ben Ogle
e3c3779a73
Don’t need to return the list. So just return
2014-06-25 15:26:13 -07:00
Ben Ogle
9cc1244f32
Compute the longest line width based on the longest line
2014-06-25 15:26:13 -07:00
Nathan Sobo
8d71e3f69a
Merge pull request #2740 from atom/bo-round-scroll-vars
...
Never allow partial pixel values for scroll
2014-06-25 09:45:47 -06:00
Ben Ogle
d6f217f80a
Never allow partial pixel values for scroll
2014-06-24 18:09:03 -07:00
Nathan Sobo
27a959ec16
Combine all updates that occur in an animation frame
2014-06-24 18:48:59 -06:00
Kevin Sawicki
0369d77c85
Ensure grammars are only activated once
2014-06-24 16:21:56 -07:00
Ben Ogle
866bc02d68
💄 Inline the gutter component
2014-06-24 14:47:26 -07:00
Nathan Sobo
5481b37d01
Merge pull request #2735 from atom/ns-react-precompute-pixel-rects
...
Compute pixel rects of cursors and highlights in EditorComponent
2014-06-24 13:34:56 -06:00
Nathan Sobo
b127155805
Only pause cursor blink when cursors actually move
...
Not when they are just repositioned due to lineHeight/charWidth changes
2014-06-24 13:26:21 -06:00
Nathan Sobo
74dbfbc956
Add HighlightComponent::shouldComponentUpdate
2014-06-24 13:04:48 -06:00
Nathan Sobo
f41a9739ac
💄
2014-06-24 13:02:41 -06:00
Nathan Sobo
b75e748ec5
Restore pausing of cursor blink on cursor movement
2014-06-24 12:59:13 -06:00
Nathan Sobo
3f9fdad478
Precompute pixel rects for highlight decorations in EditorComponent
2014-06-24 12:56:52 -06:00
Nathan Sobo
0150b40376
Implement CursorComponent::shouldComponentUpdate
...
This prevents re-rendering cursors on blink, since only the class on
the outer component changes.
2014-06-24 12:42:58 -06:00
Nathan Sobo
d3e6bd038f
Precompute cursor pixel rects in EditorComponent and pass them down
2014-06-24 12:40:56 -06: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
Kevin Sawicki
1c2e997415
Merge pull request #2700 from atom/bo-grammar-preload
...
Preload grammars on deserialization
2014-06-24 08:26:57 -07:00
Ben Ogle
9b577ecbf8
Make lines 100% of the width of their container
...
This is part of the solution to #2701 . Lines need to be 100% wide in
case a class styles their background.
2014-06-23 22:46:27 -06:00
Ben Ogle
d57119793b
Properly disable nextTick when calling requestAnimationFrame
...
My previous commit was nonsense because it set the ::performSyncUpdates
flag back to false before the animation frame callback ever got fired.
/cc again @benogle
2014-06-23 22:35: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
Ben Ogle
5ebb17c2e8
Be defensive when iterating through decorations
2014-06-23 18:03:19 -07:00
Kevin Sawicki
f741b1d6a6
Store timings for deserializing project and workspace
2014-06-23 17:46:44 -07:00
Ben Ogle
36280bb3a7
Add noop for resetDisplay
...
fixes #2674
2014-06-23 17:46:35 -07:00
Kevin Sawicki
15ccfac75a
💄
2014-06-23 17:46:31 -07:00
Kevin Sawicki
5529f13cc6
Only create grammar load promise once
2014-06-23 17:33:05 -07:00
Kevin Sawicki
0a54233ef0
Merge branch 'master' into bo-grammar-preload
2014-06-23 17:05:48 -07:00
Ben Ogle
b4f4ef8ec4
💄
...
Make it not suck.
2014-06-23 17:04:32 -07:00
Kevin Sawicki
e11785ce98
Serialize packages names in Workspace
2014-06-23 16:56:46 -07:00
Kevin Sawicki
becdca0858
Store grammars in Atom::unloadEditorWindow
2014-06-23 16:30:02 -07:00
Kevin Sawicki
c9e3ca3d69
Remove logging
2014-06-23 16:23:07 -07:00
Kevin Sawicki
6336ffbf44
Store included grammar scopes
2014-06-23 16:22:37 -07:00
Kevin Sawicki
6aeca79d1b
Return empty promise when already loaded
2014-06-23 16:13:13 -07:00
Kevin Sawicki
e76b24f8ad
Catch error
2014-06-23 16:04:25 -07:00
Kevin Sawicki
0304f187dd
Remove preload request from deserializeParams
2014-06-23 16:03:56 -07:00
Kevin Sawicki
968ab0e41d
Remove unused methods
2014-06-23 16:02:45 -07:00