diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-03-23 09:59:08 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-03-23 09:59:08 (GMT) |
commit | ff955a7522d3517a71ee5427c360075be87f056d (patch) | |
tree | 4ac81cff611ef204ec3081de70e0884ee6dfb5f3 /library | |
parent | 6217f91705eb0d6550f5376c362942971284a102 (diff) | |
download | tcl-ff955a7522d3517a71ee5427c360075be87f056d.zip tcl-ff955a7522d3517a71ee5427c360075be87f056d.tar.gz tcl-ff955a7522d3517a71ee5427c360075be87f056d.tar.bz2 |
(cherry-pick): Fix [f1253530cdd83e66]: Different Windows / *nix default bindings for text widget
See: [https://groups.google.com/forum/#!topic/comp.lang.tcl/ZZ_WwfQdmoE].
People like Eric Brunel, who want the most logical behavior for any Tcl release can simply do:
set ::tcl_wordchars {\w}
set ::tcl_nonwordchars {\W}
Diffstat (limited to 'library')
-rw-r--r-- | library/word.tcl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/library/word.tcl b/library/word.tcl index b8f34a5..3e4bc3a 100644 --- a/library/word.tcl +++ b/library/word.tcl @@ -15,12 +15,20 @@ if {$::tcl_platform(platform) eq "windows"} { # Windows style - any but a unicode space char - set ::tcl_wordchars {\S} - set ::tcl_nonwordchars {\s} + if {![info exists ::tcl_wordchars]} { + set ::tcl_wordchars {\S} + } + if {![info exists ::tcl_nonwordchars]} { + set ::tcl_nonwordchars {\s} + } } else { # Motif style - any unicode word char (number, letter, or underscore) - set ::tcl_wordchars {\w} - set ::tcl_nonwordchars {\W} + if {![info exists ::tcl_wordchars]} { + set ::tcl_wordchars {\w} + } + if {![info exists ::tcl_nonwordchars]} { + set ::tcl_nonwordchars {\W} + } } # Arrange for caches of the real matcher REs to be kept, which enables the REs |