summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogel@noemail.net>2016-06-11 15:04:55 (GMT)
committerfvogel <fvogel@noemail.net>2016-06-11 15:04:55 (GMT)
commit822dd5e5fdcb7354d60394e0d3fc9c61b905c1b9 (patch)
treef239d8cafe7e8826ae0fa4848c84dd383c5e40ec
parente2e0dcaae37560db1d6dc2d720a26abcf7bc55f1 (diff)
parenta85058ac433e05f10c62b57688ef85efb68ff332 (diff)
downloadtk-822dd5e5fdcb7354d60394e0d3fc9c61b905c1b9.zip
tk-822dd5e5fdcb7354d60394e0d3fc9c61b905c1b9.tar.gz
tk-822dd5e5fdcb7354d60394e0d3fc9c61b905c1b9.tar.bz2
Fixed [6976e4b3b2] - -undo options not correct for peers
FossilOrigin-Name: 01206c46913ee6670e065d3d2aadb2b6a2008984
-rw-r--r--generic/tkText.c9
-rw-r--r--tests/text.test15
2 files changed, 21 insertions, 3 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index ea2aed3..bd28a6c 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -122,7 +122,8 @@ static const Tk_ObjCustomOption lineOption = {
static const Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BOOLEAN, "-autoseparators", "autoSeparators",
"AutoSeparators", DEF_TEXT_AUTO_SEPARATORS, -1,
- Tk_Offset(TkText, autoSeparators), 0, 0, 0},
+ Tk_Offset(TkText, autoSeparators),
+ TK_OPTION_DONT_SET_DEFAULT, 0, 0},
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_TEXT_BG_COLOR, -1, Tk_Offset(TkText, border),
0, DEF_TEXT_BG_MONO, 0},
@@ -193,7 +194,8 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_TEXT_INSERT_WIDTH, -1, Tk_Offset(TkText, insertWidth),
0, 0, 0},
{TK_OPTION_INT, "-maxundo", "maxUndo", "MaxUndo",
- DEF_TEXT_MAX_UNDO, -1, Tk_Offset(TkText, maxUndo), 0, 0, 0},
+ DEF_TEXT_MAX_UNDO, -1, Tk_Offset(TkText, maxUndo),
+ TK_OPTION_DONT_SET_DEFAULT, 0, 0},
{TK_OPTION_PIXELS, "-padx", "padX", "Pad",
DEF_TEXT_PADX, -1, Tk_Offset(TkText, padX), 0, 0,
TK_TEXT_LINE_GEOMETRY},
@@ -239,7 +241,8 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_TEXT_TAKE_FOCUS, -1, Tk_Offset(TkText, takeFocus),
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-undo", "undo", "Undo",
- DEF_TEXT_UNDO, -1, Tk_Offset(TkText, undo), 0, 0 , 0},
+ DEF_TEXT_UNDO, -1, Tk_Offset(TkText, undo),
+ TK_OPTION_DONT_SET_DEFAULT, 0 , 0},
{TK_OPTION_INT, "-width", "width", "Width",
DEF_TEXT_WIDTH, -1, Tk_Offset(TkText, width), 0, 0,
TK_TEXT_LINE_GEOMETRY},
diff --git a/tests/text.test b/tests/text.test
index 95a7f3a..8723d3d 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6383,6 +6383,21 @@ test text-27.16 {-maxundo configuration option} -body {
} -cleanup {
destroy .t
} -result "line 1\n\n"
+test text-27.16a {undo configuration options with peers} -body {
+ text .t -undo 1 -autoseparators 0 -maxundo 100
+ .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
+} -result {1 1 0 0 100 100 1 1}
test text-27.17 {bug fix 1536735 - undo with empty text} -body {
text .t -undo 1
set r [.t edit modified]