summaryrefslogtreecommitdiffstats
path: root/library/entry.tcl
diff options
context:
space:
mode:
authorculler <culler>2019-10-25 03:12:39 (GMT)
committerculler <culler>2019-10-25 03:12:39 (GMT)
commit86e70bdd43b53d05c78b4709c42753e464bb3fec (patch)
treee0fc60636953b587130820d3dddfe02a997d4d93 /library/entry.tcl
parentc9c3c73d09cd696f710a5c6bfd731d9cdb243276 (diff)
downloadtk-86e70bdd43b53d05c78b4709c42753e464bb3fec.zip
tk-86e70bdd43b53d05c78b4709c42753e464bb3fec.tar.gz
tk-86e70bdd43b53d05c78b4709c42753e464bb3fec.tar.bz2
Add some protections against Tcl errors during IME text entry.
Diffstat (limited to 'library/entry.tcl')
-rw-r--r--library/entry.tcl6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/entry.tcl b/library/entry.tcl
index 2c72fee..2aab934 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -278,7 +278,11 @@ bind Entry <<TkStartIMEMarkedText>> {
dict set ::tk::Priv(IMETextMark) "%W" [%W index insert]
}
bind Entry <<TkEndIMEMarkedText>> {
- %W selection range [dict get $::tk::Priv(IMETextMark) "%W"] insert
+ if { [catch {dict get $::tk::Priv(IMETextMark) "%W"} mark] } {
+ bell
+ } else {
+ %W selection range $mark insert
+ }
}
bind Entry <<TkClearIMEMarkedText>> {
%W delete [dict get $::tk::Priv(IMETextMark) "%W"] [%W index insert]