Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Fork #1

Merged
merged 69 commits into from Mar 22, 2018
Merged

Update Fork #1

merged 69 commits into from Mar 22, 2018

Conversation

chgibb
Copy link
Owner

@chgibb chgibb commented Mar 22, 2018

No description provided.

Antonio Scandurra and others added 30 commits March 15, 2018 11:22
This fixes a logic error on master that uses `Anchor::offset` as an
offset into the fragment. This is wrong because fragments could be
subject to further splits, thus making the relative offset potentially
invalid.
This avoids unnecessary lookups in the buffer tree when the anchor's
position has already been retrieved since the last edit.

We are representing the cache as a RefCell to avoid the need to acquire
a mutable reference to the buffer even if we just need to query it. If
the cache is already borrowed for some reason, we will simply skip
writing to it.
This will allow to efficiently clone the FragmentId (i.e., without heap
allocations) for comparison purposes when it's used during a tree
traversal.
`lazy_static!` requires variables to be thread-safe (for good reasons),
so we have also replaced `Rc` with an `Arc`. This doesn't seem to affect
performance in a significant way.
When moving cursors, we heavily rely on `Buffer::len_for_row` to
understand when such cursors should wrap. This method is implemented by
traversing the tree twice: the first traversal gets the offset of the
beginning of the requested line, whereas the second traversal gets the
offset of the line next to the requested one. Then, the two offsets are
subtracted to obtain the length of the line.

With this commit we start caching the mapping between offsets and
points. This allows to skip the two traversals and retrieve the length
of a line in constant time if the line length had been computed before
and no edit has occurred since then.
Optimize cursor movement and selection manipulation
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Nathan Sobo <nathan@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
In Client::poll, we need to loop when polling the socket and the channel
until we receive a NotReady event. This ensures that the parent task is
woken up again when we receive more input.

Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored by: Nathan Sobo <nathan@github.com>
This is a more OO approach that simplifies the interface of
message-handling methods.

Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Nathan Sobo <nathan@github.com>
(As opposed to through an mpsc channel).

Co-authored-by: Nathan Sobo <nathan@github.com>
This will allow for a more composable way of notifying the window that a
view is dirty. The view can maintain its own definition of dirtiness or
derive it from one or more model objects.

Co-authored-by: Nathan Sobo <nathan@github.com>
Co-authored-by: Nathan Sobo <nathan@github.com>
Co-authored-by: Nathan Sobo <nathan@github.com>
Nathan Sobo and others added 29 commits March 22, 2018 03:54
This ensures that the future that forwards window updates is dropped
when the window client disconnects.

Co-authored-by: Antonio Scandurra <as-cii@github.com>
If a new window client appears, we create a new window update stream and
cause any previous update streams to terminate.
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
We won't have much that isn't a component, so this makes things less
verbose. Worst case we can put all the components in a folder.

Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
We did a bunch of other changes in this commit to the styling framework
while debugging an issue. We're just going to roll with it.

Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Co-authored-by: Nathan Sobo <nathan@github.com>
This way, the view can call `add_view` inside of `did_mount` without
double-borrowing the window Inner.
Also, remove the `workspace` field on Windows and simply add the
workspace as the window's root view from the outside.
The call to setState was causing the editor to render twice for each
scroll event: once due to the state update and a second time shortly
afterward due to the message from the server.
Co-authored-by: Nathan Sobo <nathan@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Co-authored-by: Antonio Scandurra <as-cii@github.com>
Now that we use a client/server architecture, we don't need bindings
into V8. We may resurrect this code later if we want to provide bindings
to an embedded V8 VM in the server.

Co-authored-by: Antonio Scandurra <as-cii@github.com>
This name more accurately reflects the order of operations.
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
Switch to a client/server architecture
Co-authored-by: Max Brunsfeld <maxbrunsfeld@github.com>
We're going to focus on getting to collaboration as quickly as possible
rather than producing a web-based editor.
@chgibb chgibb merged commit 4fd6002 into chgibb:master Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants