Nathan Sobo
accee294dc
Test against real mousedown events dispatched on the .lines DOM node
2014-04-22 17:09:37 -06:00
Nathan Sobo
1239ab540f
💄 spec descriptions
2014-04-22 17:09:37 -06:00
Nathan Sobo
5a0d7e716b
When cmd-clicking, add a new cursor at the nearest screen position
2014-04-22 17:09:37 -06:00
Nathan Sobo
af9355e4e6
Add Editor::getSelectedScreenRanges
2014-04-22 17:09:37 -06:00
Nathan Sobo
7738e74df0
When shift-clicking, select to the clicked position
2014-04-22 17:09:36 -06:00
Nathan Sobo
3a433f734c
Move the cursor on single click
2014-04-22 17:09:36 -06:00
Nathan Sobo
b0ad5e2f69
💄
2014-04-22 17:09:36 -06:00
Nathan Sobo
0c960552f0
Batch updates on input events
2014-04-22 17:09:36 -06:00
Nathan Sobo
8772e96935
Temporarily remove '.editor' class from react editor wrapper
...
This will prevent warnings from packages during testing.
2014-04-22 17:09:36 -06:00
Nathan Sobo
e24196c0ef
Require React directly rather than via reactionary
...
Reactionary is just a tiny helper library that can rely on the react
installed by the requiring application instead.
2014-04-22 17:09:36 -06:00
Nathan Sobo
b879221a96
💄 Clarify variable name
2014-04-22 17:09:05 -06:00
Nathan Sobo
97a353b31a
Measure each line with a fresh range
...
Recycling the range leads to strange timing-related measurement errors
in certain cases.
2014-04-22 17:09:05 -06:00
Nathan Sobo
57e2cf80f4
💄 Reorganize spec
2014-04-22 17:09:05 -06:00
Nathan Sobo
669586c11b
💄
2014-04-22 17:09:05 -06:00
Nathan Sobo
5b79bb7f66
Wait longer to clear preserved lines after mousewheel events
2014-04-22 17:09:05 -06:00
Nathan Sobo
fd2ed9a1bc
Prevent scroll event feedback loops after scrolling via the model layer
...
When scrolling via the model layer, such as happens on autoscroll due to
moving the cursor, we update the scroll position of the fake vertical
scrollbar manually. When we receive the scroll event that results from
this, we want to do nothing. The best way to determine whether we're
getting a "real" scroll event from the user or feedback from setting
the scrollTop ourselves is to compare the scrollTop to what's in the
model. If the values are equal, there's no need to request an animation
frame to assign it. This improves performance.
2014-04-22 17:09:04 -06:00
Nathan Sobo
95bf08dfa0
Eliminate overlayer by preserving lines during mousewheel events
...
Previously, the overlayer served as a permanent target for mousewheel
events that would never be removed by scrolling. This is because the
velocity scrolling effect on a trackpad is implemented by repeating
events on the original mousewheel event target. If this target is
removed, the events stop repeating and the velocity effect is ruined.
Now we refrain from removing any lines until mousewheel events stop
flowing.
2014-04-22 17:09:04 -06:00
Nathan Sobo
3d3b72a954
Render selections
2014-04-22 17:09:04 -06:00
Nathan Sobo
724babdcb6
Only update vertical scrollbar's scrollTop if it has changed
2014-04-22 17:09:04 -06:00
Nathan Sobo
bad2cebd6e
Add Editor::setSelectedScreenRange
2014-04-22 17:09:04 -06:00
Nathan Sobo
565b611c18
Do a better job imitating the old SpacePen-based editor
2014-04-22 17:09:04 -06:00
Nathan Sobo
1b8f23722b
Correctly close scope spans when rendering line HTML
2014-04-22 17:09:04 -06:00
Nathan Sobo
ab02d5f25f
Update the vertical scroll bar when scrollTop changes in the model
2014-04-22 17:09:04 -06:00
Nathan Sobo
e472d7b038
Add autoscrolling with react editor view
...
Its implemented in the model to restrict touching of the DOM.
2014-04-22 17:09:04 -06:00
Nathan Sobo
ba83b0ede0
Update height of DisplayBuffer from editor component on overflow changed
2014-04-22 17:09:04 -06:00
Nathan Sobo
96e6ddac2e
Prevent out-of-bounds scrollTop assignment on DisplayBuffer
2014-04-22 17:09:04 -06:00
Nathan Sobo
08bd03b706
Opt in to editor view only when core.useNewEditor is true
2014-04-22 17:09:04 -06:00
Nathan Sobo
2f42f23ec6
Revert changes to editor-view
2014-04-22 17:09:03 -06:00
Nathan Sobo
5a8ca1ae66
Move screen-related properties to DisplayBuffer
...
Scroll positions, height, width, line height. We force update when one
of these observed properties changes.
2014-04-22 17:09:03 -06:00
Nathan Sobo
9898cbc52e
Remove space-pencil dependency
2014-04-22 17:09:03 -06:00
Nathan Sobo
53cc5c9856
Base cursor x position on char widths stored in DisplayBuffer
...
Whenever new lines are added to the screen, we measure and store any
unseen scope/character combinations in the DisplayBuffer.
2014-04-22 17:09:03 -06:00
Nathan Sobo
148a9f0248
Add DisplayBuffer::pixelPositionForScreenPosition
...
This bakes character width tracking into display buffer directly, which
moves us toward a world where all rendering decisions can be made in the
model to strictly control DOM reads.
2014-04-22 17:09:03 -06:00
Nathan Sobo
48e2302ccb
Handle almost all editor commands in EditorComponent
2014-04-22 17:09:03 -06:00
Nathan Sobo
6327094696
Transfer focus from editor component to its hidden input
2014-04-22 17:09:03 -06:00
Nathan Sobo
c4fdb54650
Update editor component when a visible selection is removed
2014-04-22 17:09:03 -06:00
Nathan Sobo
a55c329226
💄
2014-04-22 17:09:03 -06:00
Nathan Sobo
e365e51a2b
Render all visible cursors
2014-04-22 17:09:03 -06:00
Nathan Sobo
c44fd62eb1
Update cursor view when selection screen position changes
2014-04-22 17:09:03 -06:00
Nathan Sobo
9c2d321327
Break out selection, cursor, and input components
2014-04-22 17:09:02 -06:00
Nathan Sobo
70e5880b1d
Start on cursor rendering
2014-04-22 17:09:02 -06:00
Nathan Sobo
61d9ff4ba4
Put the hidden input in the overlayer
...
The overlayer is absolutely positioned to exactly fill the scroll-view.
If we can retain this strategy and never give the input a position that
exceeds the bounds of the overlayer, we can guarantee that it never
forces the scroll position of the scroll view to change when it is
focused due to the browsers default behavior.
2014-04-22 17:09:02 -06:00
Nathan Sobo
e4c1bf10f5
Handle basic input
2014-04-22 17:09:02 -06:00
Nathan Sobo
c2858fcae2
Use overflow: hidden for editor
2014-04-22 17:09:02 -06:00
Nathan Sobo
fddd411279
Use className instead of class
...
Might as well go with the flow
2014-04-22 17:09:02 -06:00
Nathan Sobo
2dda577d7c
Improve TokenizedLine::getScopeTree specs and fix bug
2014-04-22 17:09:02 -06:00
Nathan Sobo
958bc638d7
Improve scrolling performance
2014-04-22 17:09:02 -06:00
Nathan Sobo
33ed403818
Update editor with tokenized lines when it appears on screen.
2014-04-22 17:09:02 -06:00
Nathan Sobo
3c69fd2d49
Handle mouse wheel and make some tweaks to improve scroll performance
2014-04-22 17:09:02 -06:00
Nathan Sobo
a134a60ce8
Render the entire editor with React. Handle vertical scrolling.
...
The space-pen view is now a simple wrapper around the entire React
component to integrate it cleanly into our existing system. React
components can't adopt existing DOM nodes, otherwise I would just have
the react component take over the entire view instead of wrapping.
2014-04-22 17:09:02 -06:00
Nathan Sobo
9c49a2d970
Use reactionary helper for creating virtual DOM elements
2014-04-22 17:09:01 -06:00