bpo-21474: Update IDLE word/identifier definition from ascii to unico… · python/cpython@3d11630

@@ -1658,12 +1658,12 @@ def get_accelerator(keydefs, eventname):

165816581659165916601660

def fixwordbreaks(root):

1661-

# Make sure that Tk's double-click and next/previous word

1662-

# operations use our definition of a word (i.e. an identifier)

1661+

# On Windows, tcl/tk breaks 'words' only on spaces, as in Command Prompt.

1662+

# We want Motif style everywhere. See #21474, msg218992 and followup.

16631663

tk = root.tk

16641664

tk.call('tcl_wordBreakAfter', 'a b', 0) # make sure word.tcl is loaded

1665-

tk.call('set', 'tcl_wordchars', '[a-zA-Z0-9_]')

1666-

tk.call('set', 'tcl_nonwordchars', '[^a-zA-Z0-9_]')

1665+

tk.call('set', 'tcl_wordchars', r'\w')

1666+

tk.call('set', 'tcl_nonwordchars', r'\W')

166716671668166816691669

def _editor_window(parent): # htest #