summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpspjuth <pspjuth@noemail.net>2016-08-30 19:46:35 (GMT)
committerpspjuth <pspjuth@noemail.net>2016-08-30 19:46:35 (GMT)
commita53635d94c07e610f71185c32320786fddb6b9f8 (patch)
tree87cc0e3475fbad8569ee27b754309c91c32fd713
parentd9cd0bfd1bd80544ee580215e8df5bf10ce4ae33 (diff)
downloadtk-a53635d94c07e610f71185c32320786fddb6b9f8.zip
tk-a53635d94c07e610f71185c32320786fddb6b9f8.tar.gz
tk-a53635d94c07e610f71185c32320786fddb6b9f8.tar.bz2
Made text widget's default undo false again.
FossilOrigin-Name: c8256e859a6613204f4e0c0e8863088a34dc7d56
-rw-r--r--generic/tkText.c2
-rw-r--r--tests/text.test44
2 files changed, 44 insertions, 2 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 5ad527a..ab77d99 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -547,7 +547,7 @@ CreateWidget(
Tcl_InitHashTable(&sharedPtr->windowTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&sharedPtr->imageTable, TCL_STRING_KEYS);
sharedPtr->undoStack = TkUndoInitStack(interp,0);
- sharedPtr->undo = 1;
+ sharedPtr->undo = 0;
sharedPtr->isDirty = 0;
sharedPtr->dirtyMode = TK_TEXT_DIRTY_NORMAL;
sharedPtr->autoSeparators = 1;
diff --git a/tests/text.test b/tests/text.test
index 720afbe..f640817 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -29,6 +29,15 @@ test text-1.1 {configuration option: "autoseparators"} -setup {
} -cleanup {
destroy .t
} -result {1}
+test text-1.1b {configuration option: "autoseparators", default} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t cget -autoseparators
+} -cleanup {
+ destroy .t
+} -result {1}
test text-1.2 {configuration option: "autoseparators"} -setup {
text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
pack .t
@@ -428,6 +437,15 @@ test text-1.43 {configuration option: "maxundo"} -setup {
} -cleanup {
destroy .t
} -result {5}
+test text-1.43b {configuration option: "maxundo", default} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t cget -maxundo
+} -cleanup {
+ destroy .t
+} -result {0}
test text-1.44 {configuration option: "maxundo"} -setup {
text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
pack .t
@@ -732,6 +750,15 @@ test text-1.75 {configuration option: "undo"} -setup {
} -cleanup {
destroy .t
} -result {1}
+test text-1.75b {configuration option: "undo", default} -setup {
+ text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
+ pack .t
+ update
+} -body {
+ .t cget -undo
+} -cleanup {
+ destroy .t
+} -result {0}
test text-1.76 {configuration option: "undo"} -setup {
text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold}
pack .t
@@ -6396,8 +6423,23 @@ test text-27.16a {undo configuration options with peers} -body {
lappend res [.t edit canundo]
lappend res [.tt edit canundo]
} -cleanup {
- destroy .t
+ destroy .t .tt
} -result {1 1 0 0 100 100 1 1}
+test text-27.16b {undo configuration options with peers, defaults} -body {
+ text .t
+ .t peer create .tt
+ set res [.t cget -undo]
+ lappend res [.tt cget -undo]
+ lappend res [.t cget -autoseparators]
+ lappend res [.tt cget -autoseparators]
+ lappend res [.t cget -maxundo]
+ lappend res [.tt cget -maxundo]
+ .t insert end "The undo stack is common between peers"
+ lappend res [.t edit canundo]
+ lappend res [.tt edit canundo]
+} -cleanup {
+ destroy .t .tt
+} -result {0 0 1 1 0 0 0 0}
test text-27.17 {bug fix 1536735 - undo with empty text} -body {
text .t -undo 1
set r [.t edit modified]