Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Missing API on ReactEditorView #2428

Closed

Description

@abe33

@nathansobo: As discussed on Campfire I'll try to list the missing methods/properties/elements on the ReactEditorView class. This is not exhaustive, maybe others can help filling the holes here.

On the editor view itself:

  • overlayer div and outlet are missing (which I use on abe33/atom-color-highlight, but I've already wrote a workaround), whereunderlayer point to .selections (and as far as I can tell the highlight-selected package by @richrace fail to append markers in it)
  • scrollView outlet is missing.
  • getModel is missing. (on Make react the default editor #2423)
  • getFontSize is missing.
  • buildLineElementsForScreenRows and others line building methods are missing, but are probably the part of the problem behind the changes to React, so...

On the gutter:

  • getLineNumberElement is missing (breaks coffee-lint by @dotcypress)

Activity

  1. smashwilson commented on May 28, 2014

    @smashwilson
    Contributor

    As it happens, I was just starting to work on this myself in smashwilson/merge-conflicts#57. I'm hiding the differences behind an EditorAdapter, but thus far the differences are:

    • The overlayer bit, although I would consider it cleaner to have a method on the EditorView itself to append child views. I found appendToLinesView on the react editor, which should do nicely.
    • renderedLines outlet.
    • getFirstVisibleScreenRow and getLastVisibleScreenRow aren't there.
    • lineElementForScreenRow appears to be lineNodeForScreenRow.
  2. abe33 commented on May 28, 2014

    @abe33
    ContributorAuthor

    It also appears that the minimap view will have to be completely rewritten as well, a lot of things changes between the two views.
    Maybe @nathansobo have some clues as to where I should start for a new version, the idea being to reuse as most as possible of what the original editor view already handle, just changing the start and end rows to repaint on render updates.

  3. richrace commented on May 29, 2014

    @richrace

    I'm not really doing any work on the highlight-selected package until the Marker API has been finished. So I haven't really looked into the problem.

    Also, my other package (highlight-line link) uses a work around for lineElementForScreenRow. But doesn't use lineNodeForScreenRow as in the current Atom release (0.99.0) it returns undefined.

  4. smashwilson commented on May 29, 2014

    @smashwilson
    Contributor

    merge-conflicts now works across both editors, although the styles are a little off:

    screen shot 2014-05-29 at 9 52 55 am

  5. smashwilson commented on May 29, 2014

    @smashwilson
    Contributor

    .overlay .from-top elements are behaving strangely, though:

    screen shot 2014-05-29 at 9 58 00 am

  6. smashwilson commented on May 29, 2014

    @smashwilson
    Contributor

    Ah, it looks like there's some overeager CSS:

    .panes .pane .item-views > .react-wrapper > * {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
    }

    This is overriding the positioning styles from .overlay.

  7. smashwilson commented on May 29, 2014

    @smashwilson
    Contributor

    ☕ == tons of @smashwilson comments

    Here's my workaround:

    // Temporary React editor workaround.
    .panes .pane .item-views > .react-wrapper > .overlay.resolver {
      left: 50%;
      padding: 10px;
      bottom: auto;
    }

    merge-conflicts now works seamlessly across both editors. Pretty slick! ✨

  8. self-assigned this
    on Jun 5, 2014
  9. lock commented on Jan 26, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  10. locked as resolved and limited conversation to collaborators on Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions