def ask_search str=nil
      # the following is a change that enables callers to prompt for the string
      # using some other style, basically the classical style and send the string in
      str = get_string("Enter pattern: ", :title => "Find pattern") unless str
      return if str.nil?
      str = @last_regex if str == ""
      return if !str or str == ""
      str = Regexp.new str if str.is_a? String
      ix = next_match str
      return unless ix
      @last_regex = str

      #@oldindex = @current_index
      @current_index = ix[0]
      @curpos = ix[1]
      ensure_visible
    end
def ask_search str=nil
      # the following is a change that enables callers to prompt for the string
      # using some other style, basically the classical style and send the string in
      str = get_string("Enter pattern: ", :title => "Find pattern") unless str
      return if str.nil?
      str = @last_regex if str == ""
      return if !str or str == ""
      str = Regexp.new str if str.is_a? String
      ix = next_match str
      return unless ix
      @last_regex = str

      #@oldindex = @current_index
      @current_index = ix[0]
      @curpos = ix[1]
      ensure_visible
    end
---- Section search related start ----- {{{

 Ask user for string to search for
 This uses the dialog, but what if user wants the old style.
 Isn't there a cleaner way to let user override style, or allow user
 to use own UI for getting pattern and then passing here.
 @param str default nil. If not passed, then user is prompted using get_string dialog
    This allows caller to use own method to prompt for string such as 'get_line' or 'rbgetstr' /
    'ask()'