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

Search addon: Support "find as you type" #1660

Closed
Tyriar opened this issue Sep 5, 2018 · 7 comments
Closed

Search addon: Support "find as you type" #1660

Tyriar opened this issue Sep 5, 2018 · 7 comments
Labels
help wanted type/enhancement Features or improvements to existing features
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 5, 2018

It would be nice to have a browser-style “find-as-you-type” logic. I think it would work if a couple functions were added:

  • findCurrentOrNext(needle)
  • findCurrentOrPrevious(needle)

These would expand the current selection if the needle is present at the 0-index of the current selection; otherwise they’d do a normal findNext or findPrevious.

Plan issue: #705

@Tyriar Tyriar added type/enhancement Features or improvements to existing features help wanted addon labels Sep 5, 2018
@peacefullatom
Copy link
Contributor

May I grab this? 😃

@Tyriar
Copy link
Member Author

Tyriar commented Sep 14, 2018

@peacefullatom that would be great! 😃

@peacefullatom
Copy link
Contributor

Need to refine some things:

  1. The "find as you type" feature should only work for the selected fragment?
  2. We taking into account only the visible part of the terminal?

@Tyriar
Copy link
Member Author

Tyriar commented Sep 21, 2018

@peacefullatom sorry about the delay.

  1. The primary difference between this and the normal search is that if the term is still matched by expanding the selection to the right, it should just do that, rather than going to the next term.
  2. It should still search the whole buffer.

@peacefullatom
Copy link
Contributor

Thanks a lot! 😃

@Tyriar
Copy link
Member Author

Tyriar commented Sep 21, 2018

This may just be a matter of starting the search at the current cursor position, rather than the next line (or at the end of the search term). In that case maybe this makes more sense as an option?

export interface ISearchOptions {
regex?: boolean;
wholeWord?: boolean;
caseSensitive?: boolean;
}

@peacefullatom
Copy link
Contributor

Yes, it makes sense.
In case if user hits enter we perform regular search, in case if new symbol is readable we are updating the search term and reruning a whole routine.
Now the goals are clear, thank you 😃

This was referenced Dec 11, 2018
@Tyriar Tyriar added this to the 3.10.0 milestone Dec 17, 2018
Tyriar added a commit that referenced this issue Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

No branches or pull requests

2 participants