minimap icon indicating copy to clipboard operation
minimap copied to clipboard

Implement a decorateMarkerLayer function for minimap

Open maxbrunsfeld opened this issue 8 years ago • 8 comments

When searching for common strings in a large file, clearing the search can take a long time because of the onDidDestroy listeners registered on individual markers. Currently, Atom itself uses these listeners, but when https://github.com/atom/atom/pull/13516 lands, we will no longer need them, which will significantly improve the responsiveness of find-and-replace.

As part of testing that PR, I fired up this package, and I noticed that it prevents the performance improvement from taking affect because it also uses decorateMarker with individual markers. Have you looked into switching to the more performant TextEditor.decorateMarkerLayer API?

maxbrunsfeld avatar Dec 29 '16 19:12 maxbrunsfeld

@maxbrunsfeld if you want to create a pr that would be very helpful.

UziTech avatar Nov 21 '20 01:11 UziTech

Chaing the API from decorateMarker to decoraterMarkerLayer needs upstream changed. From what I see in the code, the calls are redirected to the minimap package

aminya avatar Dec 10 '20 02:12 aminya

It looks like decorateMarkerLayer is still experimental in Atom. @maxbrunsfeld do you know when it will be stable?

UziTech avatar Dec 11 '20 19:12 UziTech

It is not experimental. You are checking an old version of the documentation: https://flight-manual.atom.io/api/v1.53.0/TextEditor/#instance-decorateMarkerLayer

aminya avatar Dec 11 '20 19:12 aminya

Oops 🤦‍♂️

UziTech avatar Dec 11 '20 20:12 UziTech

I was not aware of this particular API and the fact that it is faster.

Minimap does not seem to use Atom's decoration API

But linter-ui-default does! I will need to create an issue there.

https://github.com/steelbrain/linter-ui-default/blob/242a5b234979890f8adb9b268e7437fd3fbb539e/lib/editor/index.js#L350

aminya avatar Dec 11 '20 20:12 aminya

@aminya does that mean this issue should be closed?

UziTech avatar Dec 11 '20 23:12 UziTech

If we can transfer this to minimap repo, we can work on it more. The code for minimap can be optimized more.

aminya avatar Dec 11 '20 23:12 aminya