gangstead / atom-incremental-search

Incremental search for the Atom editor
MIT License
16 stars 13 forks source link

Get slurping working again #49

Closed gangstead closed 8 years ago

gangstead commented 8 years ago

When I took over the package from the original author and I got this package working on Atom 1.0 API with the exception of the slurping feature.

I hope someone wants to take a crack at it. If so I'll add you as a maintainer of this repo and package.

gangstead commented 8 years ago

Child ticket #46

afinne commented 8 years ago

this.editSession.getCursor is called this.editSession.getCursors and returns an array. Taking the first one should be ok. cursor.getMoveNextWordBoundaryBufferPosition is called cursor.getNextWordBoundaryBufferPosition but I think that using getBeginningOfCurrentWordBufferPosition and getEndOfCurrentWordBufferPosition could be an idea.

Just my two cents

afinne commented 8 years ago

Just as a side note, I think that defaulting to the previously searched term is messing up a lot of things. Clearing the search buffer after it gets closed seems more logical.

gangstead commented 8 years ago

getCursor() -> getCursors()[0] is working and fixes the exception and slurping seems to be working. getMoveNextWordBoundaryBufferPosition and getNextWordBoundaryBufferPosition seem to have the same effect. I'll leave it alone for now.

Now I see the benefit of slurping. It expands the text selection to the next word boundary every time you slurp it gets bigger.

gangstead commented 8 years ago

@afinne would you like to be an official contributor to the package?

gangstead commented 8 years ago

Regarding clearing the search buffer. I took a few minutes and tried to figure out the best way to do that today and the problem is that the same key binding is used to open the search window as to search to the next item cmd/ctrl + i. It's not insurmountable but I couldn't quickly reason the best way to keep from introducing any weird behavior. Also I wasn't sure where to clear it. If you'd like to take a crack at it by all means.

afinne commented 8 years ago

Sure :) That could be fun :)