def backward_regex regex
      if regex.is_a? Symbol
        regex = @text_patterns[regex]
        raise "Pattern specified #{regex} does not exist in text_patterns " unless regex
      end
      $multiplier = 1 if !$multiplier || $multiplier == 0
      _arr = _getarray
      pos = @curpos || 0 # list does not have curpos
      line = @current_index
      #buff = _arr[line].to_s
      #return unless buff
      # if curpos is at zero , we should be checking previous line !
      $multiplier.times {
        # if at start of line, go to previous line
        if pos == 0
          if @current_index > 0
            line -= 1
            pos = _arr[line].to_s.size
          else
            # we are on first line of file at start
            break
          end
        end
        buff = _arr[line].to_s
        return unless buff
        pos2 = pos - 2
        pos2 = 0 if pos2 < 0
        found = buff.rindex(regex, pos2)
        $log.debug "  backward: pos #{pos} , found #{found}, pos2 = #{pos2} "
        if !found || found == 0
          # if not found, we've lost a counter
          if pos > 0
            pos = 0
          elsif line > 0
            #line -= 1
            #pos = _arr[line].to_s.size
          else
            break
          end
        else
          pos = found + 1
        end
        $log.debug " backward_word: pos #{pos} line #{line} buff: #{buff}"
      }
      $multiplier = 0
      @current_index = line
      @curpos = pos
      ensure_visible
      @repaint_required = true
    end
def backward_regex regex
      if regex.is_a? Symbol
        regex = @text_patterns[regex]
        raise "Pattern specified #{regex} does not exist in text_patterns " unless regex
      end
      $multiplier = 1 if !$multiplier || $multiplier == 0
      _arr = _getarray
      pos = @curpos || 0 # list does not have curpos
      line = @current_index
      #buff = _arr[line].to_s
      #return unless buff
      # if curpos is at zero , we should be checking previous line !
      $multiplier.times {
        # if at start of line, go to previous line
        if pos == 0
          if @current_index > 0
            line -= 1
            pos = _arr[line].to_s.size
          else
            # we are on first line of file at start
            break
          end
        end
        buff = _arr[line].to_s
        return unless buff
        pos2 = pos - 2
        pos2 = 0 if pos2 < 0
        found = buff.rindex(regex, pos2)
        $log.debug "  backward: pos #{pos} , found #{found}, pos2 = #{pos2} "
        if !found || found == 0
          # if not found, we've lost a counter
          if pos > 0
            pos = 0
          elsif line > 0
            #line -= 1
            #pos = _arr[line].to_s.size
          else
            break
          end
        else
          pos = found + 1
        end
        $log.debug " backward_word: pos #{pos} line #{line} buff: #{buff}"
      }
      $multiplier = 0
      @current_index = line
      @curpos = pos
      ensure_visible
      @repaint_required = true
    end
jump to previous occurence of given regexp within a line, and then to previous line
   This is more line 'w' or 'b' in vim, not like '/'
 @param [Regexp] pattern to go back to.