wiki:Features/SearchAndReplace
Last modified 3 years ago Last modified on 03/31/11 19:34:42

Search, Find and Replace

(the following text was taken from Padre.pm. It needs rewriting.

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

TO DO 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

1) without opening editors for the files. 2) 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.

Tickets

Ticket Resolution Summary Owner Reporter
#1371 fixed [0.92 osx] checkmarks for case sensitivity, etc. cannot be toggled in Replace window tome tome
#1325 Backreference substitution not working in Replace dialog FrDarryl
#1296 fixed FindFast: Ctrl+V doesn't paste into search box Sewi
#1218 fixed Ctrl-F now killing X-Windows szabgab
#1216 fixed Ctrl-F crashes Padre szabgab
#1174 wontfix Skip documentation and/or skip comments when searching szabgab
#1110 fixed Find dialog should not be a modal window zenogantner
#1043 odd behavior of regex Find zenogantner
#703 fixed Focus does not return to search dialog after error messages adamk
#641 Escape doesn't search or search/replace dialog when focused on editor adamk
#640 fixed Find and Find/Replace dialogs change focus to the editor panel after "No Matches Found" adamk
#412 fixed find/replace dialog should autocomplete daxim
#336 fixed listing all regexes in replace dialog jquelin
#318 The search should highlight all the hits with yellow marker szabgab
#280 ignore ignore case when there are upper case letters szabgab
#246 fixed limit find and replace (and maybe also search) garu szabgab
#71 search within a function szabgab

Test

  1. Open lib/Padre/Wx/Main.pm from the Padre source code
  2. Hit Ctrl+F for "Find"
  3. Enter the search term "sprintf"
  4. Click on "Find Next" several times
  5. Make sure that each result is nicely visible in the center of the editor window
  6. Activate "Search Backwards" to change the search direction
  7. Click on "Find Next" several times
  8. Activate "Case Sensitive"
  9. Modify the search term to "Sprintf"
  10. Click on "Find Next": you should not get a hit now
  11. Deactivate "Case Sensitive"
  12. Click on "Find Next": you should get a hit again
  13. Modify the search term to "Wx..gettext"
  14. Activate "Regular Expression"
  15. Click on "Find Next": you should get a hit
  16. Activate "Close Window on Hit"
  17. Click on "Find Next": you should get a hit, and the window should close
  18. Select "Search"->"Find" from the menu: The same search term as before should be in the dialog
  19. Click on "Find All" (remark: currently does not work)
  20. Close the Window
  21. Hit F3: you should get a hit
  22. Hit F3 another time
  23. Hit Shift-F3: you should be back to the former hit

TODO