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

Method toggle_tabs_event

Lib/idlelib/format.py:362–376  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

360 self.editwin = editwin
361
362 def toggle_tabs_event(self, event):
363 editwin = self.editwin
364 usetabs = editwin.usetabs
365 if askyesno(
366 "Toggle tabs",
367 "Turn tabs " + ("on", "off")[usetabs] +
368 "?\nIndent width " +
369 ("will be", "remains at")[usetabs] + " 8." +
370 "\n Note: a tab is always 8 columns",
371 parent=editwin.text):
372 editwin.usetabs = not usetabs
373 # Try to prevent inconsistent indentation.
374 # User must change indent width manually after using tabs.
375 editwin.indentwidth = 8
376 return "break"
377
378 def change_indentwidth_event(self, event):
379 editwin = self.editwin

Callers 1

test_toggle_tabsMethod · 0.95

Calls 1

askyesnoFunction · 0.90

Tested by 1

test_toggle_tabsMethod · 0.76