Skip to content
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

Add option to search ahead of the cursor #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prasoon2211
Copy link

Fixes #9 - tested on my local setup.

cc @wenhoujx

@wenhoujx
Copy link
Owner

thanks for the contribution, the idea is good, will review next week .

for (let i = 0; i < doc.lineCount; i++) {
const matches = _searchLine(i, doc.lineAt(i).text, parsed)
const lineIndex = (startLine + i) % doc.lineCount;
const matches = _searchLine(lineIndex, doc.lineAt(lineIndex).text, parsed)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the list of matches become smaller and smaller as user go down to the file?
i prefer the behavior the matched list stay constant, but the pick.activeItems changes based on the current position of the cursor.

thoughts?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you're right - that's a good idea! A bit busy these days so if you have a quick fix in mind, please go ahead and change the code. Otherwise I'll take a look soon!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, i tested the current behavior is as long as you are invoking Swiper: Swiper Search/Resume without changing the query string, it keeps track of the item last picked.

Can you try again?

@wenhoujx
Copy link
Owner

wenhoujx commented Sep 6, 2024

thanks for the contribution. sorry for the delay, i had to setup my new laptop, and now i have it setup already, so should be faster iteration from now on .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search ahead from current cursor position
2 participants