You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Status quo
I have a RSTA and search panel with a "what" text and "Find" button. I can type in a "what" text and click "Find" button. "Find" button performs SearchEngine.find(rsta, searchContext). When I click the button multiple time, the next "what" word is selected. This scenario works perfectly.
Describe the solution you'd like
I want to modify searching - when I am typing "what" word, I want the search is being performed in the background.
For example, if I have rsta with the following content abc abd
The caret is at offset 0.
I type a => the first char "a" is selected.
I press b; "what" is ab => the first 2 chars "ab" are selected.
I press d; "what" is now abd => and only now "abd" is selected.
What I did
I added whatTextField.getDocument().addDocumentListener() with calling SearchEngine.find(). However in the use-case above when I pressed on the 2nd step b, the second occurrence of "ab" is selected.
What is proposed
I think it is needed one more field to the SearchContext which controls if the search should start from the selectionStart or from the selectionEnd.
And also SearchContext.forward should be taken into account.
The text was updated successfully, but these errors were encountered:
@dzmipt You'd also want to remember the "original" caret position, so if they hit backspace in your search field enough, you can backtrack to the original position (or prior marches for the shorter partial), right?
Do you have this listener class as something you'd like to contribute to RSTA? I wonder if I could add it to either RSyntaxTextArea or RSTAUI since that project has modals you can use to control SearchContext actions.
Status quo
I have a RSTA and search panel with a "what" text and "Find" button. I can type in a "what" text and click "Find" button. "Find" button performs
SearchEngine.find(rsta, searchContext)
. When I click the button multiple time, the next "what" word is selected. This scenario works perfectly.Describe the solution you'd like
I want to modify searching - when I am typing "what" word, I want the search is being performed in the background.
For example, if I have rsta with the following content
abc abd
The caret is at offset 0.
a
=> the first char "a" is selected.b
; "what" isab
=> the first 2 chars "ab" are selected.d
; "what" is nowabd
=> and only now "abd" is selected.What I did
I added
whatTextField.getDocument().addDocumentListener()
with callingSearchEngine.find()
. However in the use-case above when I pressed on the 2nd stepb
, the second occurrence of "ab" is selected.What is proposed
I think it is needed one more field to the
SearchContext
which controls if the search should start from the selectionStart or from the selectionEnd.And also
SearchContext.forward
should be taken into account.The text was updated successfully, but these errors were encountered: