(the following text was taken from Padre.pm. It needs rewriting.
Search
Ctrl+F opens the search window, if something was selected then that is given as the search text. Otherwise the last search string should be displayed.Provide option to search backwards
Limit action to current block, current subroutine, current file (should be the default) current project, current directory with some file filters.
When the user presses Find
- We find the first hit and the search window disappears. F3 jumps to next one.
- The first match is highlighted and focused but the window stays When the user clicks on the Find button again, we jump to the next hit In this case the user must be able to edit the document while the search window is on.
- All the matches are highlighted and we go to the first match, window disappears. F3 jumps to next one
- All the matches are highlighted and we go to the first one, window stays open user can edit text
Find and Replace
- Find - find the next occurrence
- Replace all - do just that
- Replace - if currently a match is selected then replace it find the next occurrence and select it
TODO
Describe what to do if we have to deal with files that are not in the editor == If "Replace all" was pressed then do just that- without opening editors for the files.
- opening an editor for each file and keep it in unsaved state (sounds crazy having 1000 editors open...)
if Search or Replace is clicked then we might show the next location in the lower pane. If the user then presses Replace we open the file in an editor window and go on. If the user presses Search then we show the next occurrence. Opened and edited files will be left in a not saved state.
Test
- Open {{{lib/Padre/Wx/Main.pm}}} from the Padre source code
- Hit Ctrl+F for "Find"
- Enter the search term "sprintf"
- Click on "Find Next" several times
- Make sure that each result is nicely visible in the center of the editor window
- Activate "Search Backwards" to change the search direction
- Click on "Find Next" several times
- Activate "Case Sensitive"
- Modify the search term to "Sprintf"
- Click on "Find Next": you should not get a hit now
- Deactivate "Case Sensitive"
- Click on "Find Next": you should get a hit again
- Modify the search term to "Wx..gettext"
- Activate "Regular Expression"
- Click on "Find Next": you should get a hit
- Activate "Close Window on Hit"
- Click on "Find Next": you should get a hit, and the window should close
- Select "Search"->"Find" from the menu: The same search term as before should be in the dialog
- Click on "Find All" (remark: currently does not work)
- Close the Window
- Hit F3: you should get a hit
- Hit F3 another time
- Hit Shift-F3: you should be back to the former hit