fleather icon indicating copy to clipboard operation
fleather copied to clipboard

Search feature

Open vinitk-aveosoft opened this issue 1 year ago • 4 comments

Need below search functionality.

  1. Basic search
  2. Filtering based on case (Upper and Lower Case)
  3. Filter to match exact word.

vinitk-aveosoft avatar Jan 23 '24 10:01 vinitk-aveosoft

Thank you for this issue. Interested to understand the use case you have in mind @vinitk-aveosoft You have used fleather in a context where a large text is used? How long a text?

amantoux avatar Jan 24 '24 13:01 amantoux

I'm not sure what that means @amantoux . What I have in mind is some thing like below attached images. I have been using flutter_quill, but the package is very buggy. base case word

vinitk-aveosoft avatar Jan 25 '24 06:01 vinitk-aveosoft

Interesting feature! @vinitk-aveosoft Feel free to contribute!

amantoux avatar Jan 26 '24 07:01 amantoux

Hello, Only adding my two cents. From my experience, this seemingly simple feature is in fact very complex and the use cases can differ between applications. And don't forget the tests around such feature !

Prerequisites:

  • non-invasive highlighting (not changing the actual text). I think relative work was pushed beginning of January for the spellchecker. Highlighting would mean decorating with font color, red (depending on style) squiggles or underline (IOS or Mac), colored highlight,...
  • Programmatic way to jump from position to position, with selection and replacement.
  • Highlighting and cursor movement/selections externally available.

Use cases & features:

  • Handle Case sensitive/insensitive
  • Handle regular expressions
  • Handle "whole word" (careful of what is considered a word in non-latin languages ?)
  • Replace all
  • Replace next
  • Move previous / next find
  • number of occurrences, index of selected occurrence
  • UI design: Do you want a Word-like search, a VS Code-like search, a Qt-Creator-like search, a non-modal windowed search ? Imposing the search&replace UI have its pros & cons. Our view may not contend to all use cases.

My thoughts: Personally, I think that such feature could be another package, with a way to plug it in Fleather. This would be the same way a third-party spellchecker (like Antidote or LanguageTool) can be plugged in. I read somewhere that work was done toward offering this extensibility. Spellchecker API and Search/Replace can share the same API, couldn't they ?

jacquetc avatar Feb 09 '24 09:02 jacquetc