[squeak-dev] in-place search-and-replace

Chris Muller asqueaker at gmail.com
Tue Nov 17 04:30:05 UTC 2015


Squeak's ingenius solution to the search-and-replace problem has been
fixed and then improved.

The way it's supposed to work is:

  1) user selects some text
  2) user overtypes the selected text with new text
  3) then uses any combinations of cmd+g, j, or J to conduct global
search and replace operations.

         cmd+g finds the next occurrence of the original text.

         cmd+j (first press) presents the next occurrence of the
original text, scrolling it into view and selecting it.

          cmd+j (subsequent press) with the original text selected,
cmd+j now effects the replacement and then finds and selects the next
occurrence of it in the text.

         cmd+J (with Shift key) replaces all further occurrences of
the original text to the replacement text.

What changed?  Before, both cmd+j AND cmd+g used to perform the
replacement.  Cmd+g was never supposed to do that, it was a bug,
Marcel fixed it so that it only does Find Next.  That fix exposed an
awkwardness to the legacy usage of cmd+j which renders it unable to be
used in conjunction with cmd+g.  Now, it can.


More information about the Squeak-dev mailing list