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

Method untabify_region_event

Lib/idlelib/format.py:334–343  ·  view source on GitHub ↗

Expand tabs to spaces for each line in region.

(self, event=None)

Source from the content-addressed store, hash-verified

332 return "break"
333
334 def untabify_region_event(self, event=None):
335 "Expand tabs to spaces for each line in region."
336 head, tail, chars, lines = self.get_region()
337 tabwidth = self._asktabwidth()
338 if tabwidth is None:
339 return
340 for pos in range(len(lines)):
341 lines[pos] = lines[pos].expandtabs(tabwidth)
342 self.set_region(head, tail, chars, lines)
343 return "break"
344
345 def _asktabwidth(self):
346 "Return value for tab width."

Callers

nothing calls this directly

Calls 4

get_regionMethod · 0.95
_asktabwidthMethod · 0.95
set_regionMethod · 0.95
expandtabsMethod · 0.45

Tested by

no test coverage detected