docs: def get_line_number_next_to_cursor_with_string_within(self, s):
          """ Find the closest occurrence of a string with respect to the cursor position in the text view """
          line_number, _ = self.get_cursor_position()
          text_buffer = self.text_view.get_buffer()
          line_iter = text_buffer.get_iter_at_line(line_number)
  
          # find closest before line with string within
          before_line_number = None
          while line_iter.backward_line():
              if s in self.get_text_of_line(line_iter):
                  before_line_number = line_iter.get_line()
                  break
  
          # find closest after line with string within
          after_line_number = None
          while line_iter.forward_line():
              if s in self.get_text_of_line(line_iter):
                  after_line_number = line_iter.get_line()
                  break
  
          # take closest one to current position
          if after_line_number is not None and before_line_number is None:
              return after_line_number, after_line_number - line_number
          elif before_line_number is not None and after_line_number is None:
              return before_line_number, line_number - before_line_number
          elif after_line_number is not None and before_line_number is not None:
              after_distance = after_line_number - line_number
              before_distance = line_number - before_line_number
              if after_distance < before_distance:
                  return after_line_number, after_distance
              else:
                  return before_line_number, before_distance
          else:
              return None, None