class_docstr: Return struct for functions wrapped in ``text_object``.
  Both `start` and `end` are relative to the current cursor position.
class_docstr_tok: ["Return","struct","for","functions","wrapped","in","``","text_object","``",".","Both","`","start","`","and","`","end","`","are","relative","to","the","current","cursor","position","."]
docstr: Return a (start, end) tuple with start <= end that indicates the range
  operators should operate on.
  `buffer` is used to get start and end of line positions.
  
  This should return something that can be used in a slice, so the `end`
  position is *not* included.
docstr_tok: ["Return","a","(","start",",","end",")","tuple","with","start","<","=","end","that","indicates","the","range","operators","should","operate","on",".","`","buffer","`","is","used","to","get","start","and","end","of","line","positions",".","This","should","return","something","that","can","be","used","in","a","slice",",","so","the","`","end","`","position","is","*","not","*","included","."]
code: def operator_range(self, document: Document) -> tuple[int, int]:
      """
      Return a (start, end) tuple with start <= end that indicates the range
      operators should operate on.
      `buffer` is used to get start and end of line positions.
  
      This should return something that can be used in a slice, so the `end`
      position is *not* included.
      """
      start, end = self.sorted()
      doc = document
  
      if (
          self.type == TextObjectType.EXCLUSIVE
          and doc.translate_index_to_position(
              end + doc.cursor_position
          )[1]
          == 0
      ):
          # If the motion is exclusive and the end of motion is on the first
          # column, the end position becomes end of previous line.
          end -= 1
      if self.type == TextObjectType.INCLUSIVE:
          end += 1
      if self.type == TextObjectType.LINEWISE:
          # Select whole lines
          row, col = doc.translate_index_to_position(
              start + doc.cursor_position
          )
          start = (
              doc.translate_row_col_to_index(row, 0)
              - doc.cursor_position
          )
          row, col = doc.translate_index_to_position(
              end + doc.cursor_position
          )
          end = (
              doc.translate_row_col_to_index(row, len(doc.lines[row]))
              - doc.cursor_position
          )
      return start, end
  
imports: from __future__ import annotations
  import codecs
  import string
  from enum import Enum
  from itertools import accumulate
  from typing import Callable, Iterable, Tuple, TypeVar
  from prompt_toolkit.application.current import get_app
  from prompt_toolkit.buffer import Buffer, indent, reshape_text, unindent
  from prompt_toolkit.clipboard import ClipboardData
  from prompt_toolkit.document import Document
  from prompt_toolkit.filters import Always, Condition, Filter, has_arg, is_read_only, is_searching
  from prompt_toolkit.filters.app import in_paste_mode, is_multiline, vi_digraph_mode, vi_insert_mode, vi_insert_multiple_mode, vi_mode, vi_navigation_mode, vi_recording_macro, vi_replace_mode, vi_replace_single_mode, vi_search_direction_reversed, vi_selection_mode, vi_waiting_for_text_object_mode
  from prompt_toolkit.input.vt100_parser import Vt100Parser
  from prompt_toolkit.key_binding.digraphs import DIGRAPHS
  from prompt_toolkit.key_binding.key_processor import KeyPress, KeyPressEvent
  from prompt_toolkit.key_binding.vi_state import CharacterFind, InputMode
  from prompt_toolkit.keys import Keys
  from prompt_toolkit.search import SearchDirection
  from prompt_toolkit.selection import PasteMode, SelectionState, SelectionType
  from ..key_bindings import ConditionalKeyBindings, KeyBindings, KeyBindingsBase
  from .named_commands import get_by_name
label_desc: Use image node_id 4 for calling the TextObject obj's underlying member method code with example usage: obj.operator_range(document) and returns: start,  end