forked from atom-archive/xray
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 Branch #2
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Add update for 2018-03-19
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>
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.
Update Fork
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.