summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-23 10:00:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-23 10:00:40 (GMT)
commit4936a3f9d6993a339e97da0e54cdf7694d58769c (patch)
tree993b077f037380ca7cf05b6f5d44c18ea3fd42f0 /library
parenta65c0e7103d10d4dc444c2cd443ecc4ecff5f6cb (diff)
downloadtcl-4936a3f9d6993a339e97da0e54cdf7694d58769c.zip
tcl-4936a3f9d6993a339e97da0e54cdf7694d58769c.tar.gz
tcl-4936a3f9d6993a339e97da0e54cdf7694d58769c.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.tcl16
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