Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add service to access result marker layer - #614

Merged
nathansobo merged 4 commits into
masterfrom
ns-add-layer-service
Dec 8, 2015
Merged

nathansobo merged 4 commits into
masterfrom
ns-add-layer-service

Conversation

@nathansobo

Copy link
Copy Markdown
Contributor

This PR adds a new [email protected] service that exposes a single method resultsMarkerLayerForTextEditor. Give it a TextEditor, and it will return a marker layer used to store the search results for that editor. It returns null in versions of Atom prior to 1.3.0.

This should make it straightforward to fix packages that relied on finding find-and-replace markers in the default marker layer by simply wrapping introducing a service call to retrieve the appropriate layer for that editor before calling findMarkers. Everything else should remain the same.

I'm planning to hotfix this into beta tomorrow morning so it goes out with the introduction of layers.

Refs atom/atom#9208
/cc @abe33 @lee-dohm

Nathan Sobo added 4 commits December 7, 2015 16:26
Previously, we were actually leaking marker layers, creating a new one
every time we switched to a new editor without destroying the old one.
Oops. This creates a permanent association between editors and their
results layer so we don’t create extra layers.
This will be delegated to from a service we make available to other
packages.
@lee-dohm

lee-dohm commented Dec 8, 2015

Copy link
Copy Markdown
Contributor

Looks good to me!

@abe33

abe33 commented Dec 8, 2015

Copy link
Copy Markdown
Contributor

👍

It'll be so much simpler to not having to care about the active editor!

👏

nathansobo pushed a commit that referenced this pull request Dec 8, 2015
Add service to access result marker layer
@nathansobo
nathansobo merged commit a169a70 into master Dec 8, 2015
@nathansobo

Copy link
Copy Markdown
Contributor Author

Keep in mind that the service will return null instead of a layer for versions before 1.3.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants