MCPcopy Index your code
hub / github.com/python/cpython / drag_update_selection_and_insert_mark

Method drag_update_selection_and_insert_mark

Lib/idlelib/sidebar.py:190–197  ·  view source on GitHub ↗

Helper function for drag and selection event handlers.

(y_coord)

Source from the content-addressed store, hash-verified

188 auto_scrolling_after_id = None
189
190 def drag_update_selection_and_insert_mark(y_coord):
191 """Helper function for drag and selection event handlers."""
192 lineno = get_lineno(self.text, f"@0,{y_coord}")
193 a, b = sorted([start_line, lineno])
194 self.text.tag_remove("sel", "1.0", "end")
195 self.text.tag_add("sel", f"{a}.0", f"{b+1}.0")
196 self.text.mark_set("insert",
197 f"{lineno if lineno == a else lineno + 1}.0")
198
199 def b1_mousedown_handler(event):
200 nonlocal start_line

Callers

nothing calls this directly

Calls 4

get_linenoFunction · 0.85
tag_addMethod · 0.80
tag_removeMethod · 0.45
mark_setMethod · 0.45

Tested by

no test coverage detected