Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Realization of global default value for tag option -undo (bug report [5a670c16ba]). |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | revised_text-aside |
Files: | files | file ages | folders |
SHA3-256: |
1a6d99122ac9c040e2eaf56a66ba4e44 |
User & Date: | gcramer 2019-01-01 15:00:43.384 |
References
2019-01-01
| ||
15:07 | • Ticket [5a670c16] Revised text: -undo tag option default should be changed status still Open with 3 other changes artifact: e1fd84d7 user: gcramer | |
Context
2019-01-03
| ||
21:45 | Realization of global default value for tag option -undo (bug report [5a670c16ba]). check-in: a263e6c9 user: jan.nijtmans tags: revised_text, tip-466 | |
19:38 | Make the sync command generate a <<WidgetViewSync>> event after updating all line metrics. Merge the modified 11a-* tests from the legacy widget. Closed-Leaf check-in: 4aca5dbe user: culler tags: revised_text-aside | |
2019-01-01
| ||
15:00 | Realization of global default value for tag option -undo (bug report [5a670c16ba]). check-in: 1a6d9912 user: gcramer tags: revised_text-aside | |
2018-12-31
| ||
16:32 | Fix gcc warning: tkText.c:5159:55: warning: division ‘sizeof (TkTextPosition * {aka struct TkTextPosition *}) / sizeof (TkTextPosition {aka struct TkTextPosition})’ does not compute the number of array elements [-Wsizeof-pointer-div] which turns out to be an actual - but harmless - bug check-in: 1b803cf9 user: jan.nijtmans tags: revised_text-aside | |
Changes
Changes to doc/text.n.
︙ | |||
483 484 485 486 487 488 489 490 491 492 493 494 495 496 | 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | + + + + + | mode), but only if a preceding character exists in this line. This mode is commonly used in some text editors. .IP "\fBnone\fR" The new text will not receive any tags from surrounded text. .RE .OP \-undo undo Undo Specifies a boolean that says whether the undo mechanism is active or not. .OP \-undotagging undoTagging UndoTagging This boolean value specifies the setup value for \fB-undo\fR option when creating tags. Per default the setup value is \fItrue\fR. Note that this value will not be used for the special tag \fBsel\fR. See description of tag option \fB-undo\fR for more information. .OP \-width width Width Specifies the desired width for the window in units of characters in the font given by the \fB\-font\fR option. If the font does not have a uniform width then the width of the character .QW 0 is used in translating from character units to screen units. .OP \-useunibreak useUniBreak UseUniBreak |
︙ | |||
1112 1113 1114 1115 1116 1117 1118 | 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | - - + + + | may be removed in a future version. See equivalent tag option \fB\-underlinecolor\fR for a description. .TP \fB\-undo \fIboolean\fR . Specifies whether adding/removing this tag to/from text will be undone with \fBundo\fR operation. If this flag is \fIfalse\fR, then changes of tag |
︙ |
Changes to generic/tkText.c.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + | /* * tkText.c -- * * This module provides a big chunk of the implementation of multi-line * editable text widgets for Tk. Among other things, it provides the Tcl * command interfaces to text widgets. The B-tree representation of text * and its actual display are implemented elsewhere. * * Copyright (c) 1992-1994 The Regents of the University of California. * Copyright (c) 1994-1996 Sun Microsystems, Inc. * Copyright (c) 1999 by Scriptics Corporation. |
︙ | |||
373 374 375 376 377 378 379 | 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | - - + + + + | {TK_OPTION_CUSTOM, "-startline", NULL, NULL, NULL, -1, Tk_Offset(TkText, startLine), TK_OPTION_NULL_OK, &lineOption, TK_TEXT_LINE_RANGE}, #endif {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_TEXT_STATE, -1, Tk_Offset(TkText, state), 0, stateStrings, 0}, {TK_OPTION_BOOLEAN, "-steadymarks", "steadyMarks", "SteadyMarks", "0", -1, Tk_Offset(TkText, steadyMarks), TK_OPTION_DONT_SET_DEFAULT, 0, 0}, |
︙ | |||
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 | 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 | + | sharedTextPtr->affectGeometryTags = TkBitResize(NULL, TK_TEXT_SET_MAX_BIT_SIZE); sharedTextPtr->affectGeometryNonSelTags = TkBitResize(NULL, TK_TEXT_SET_MAX_BIT_SIZE); sharedTextPtr->affectLineHeightTags = TkBitResize(NULL, TK_TEXT_SET_MAX_BIT_SIZE); sharedTextPtr->tagLookup = malloc(TK_TEXT_SET_MAX_BIT_SIZE*sizeof(TkTextTag *)); sharedTextPtr->emptyTagInfoPtr = TkTextTagSetResize(NULL, 0); sharedTextPtr->maxRedoDepth = -1; sharedTextPtr->autoSeparators = true; sharedTextPtr->undoTagging = true; sharedTextPtr->lastEditMode = TK_TEXT_EDIT_OTHER; sharedTextPtr->lastUndoTokenType = -1; sharedTextPtr->startMarker = TkTextMakeStartEndMark(NULL, &tkTextLeftMarkType); sharedTextPtr->endMarker = TkTextMakeStartEndMark(NULL, &tkTextRightMarkType); sharedTextPtr->protectionMark[0] = TkTextMakeMark(NULL, NULL); sharedTextPtr->protectionMark[1] = TkTextMakeMark(NULL, NULL); sharedTextPtr->protectionMark[0]->typePtr = &tkTextProtectionMarkType; |
︙ | |||
1172 1173 1174 1175 1176 1177 1178 | 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | - - - - - - + + + + + + + | */ TkTextCreateDInfo(textPtr); TkTextIndexSetupToStartOfText(&startIndex, textPtr, sharedTextPtr->tree); TkTextSetYView(textPtr, &startIndex, 0); textPtr->exportSelection = true; textPtr->pickEvent.type = LeaveNotify; |
︙ | |||
3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 | 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 | + + - | Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; TkTextIndex start, end, current; TkSizeT currentEpoch; TkSharedText *sharedTextPtr = textPtr->sharedTextPtr; TkTextBTree tree = sharedTextPtr->tree; bool copyDownFlags = false; bool oldExport = (textPtr->exportSelection) && (!Tcl_IsSafe(textPtr->interp)); bool oldTextDebug = tkTextDebug; bool didHyphenate = textPtr->hyphenate; bool oldUndoTagging = textPtr->undoTagging; int oldHyphenRules = textPtr->hyphenRules; int mask = 0; |
︙ | |||
4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 | 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 | + + + + + + + + + | goto error; } } /* * Copy up shared flags. */ /* * Update default value for undoing tag operations. */ if (oldUndoTagging != textPtr->undoTagging) { sharedTextPtr->undoTagging = textPtr->undoTagging; copyDownFlags = true; } /* This flag cannot alter if we have peers. */ sharedTextPtr->steadyMarks = textPtr->steadyMarks; if (sharedTextPtr->autoSeparators != textPtr->autoSeparators) { sharedTextPtr->autoSeparators = textPtr->autoSeparators; copyDownFlags = true; |
︙ | |||
4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 | 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 | + | for (tPtr = sharedTextPtr->peers; tPtr; tPtr = tPtr->next) { tPtr->autoSeparators = sharedTextPtr->autoSeparators; tPtr->maxUndoDepth = sharedTextPtr->maxUndoDepth; tPtr->maxRedoDepth = sharedTextPtr->maxRedoDepth; tPtr->maxUndoSize = sharedTextPtr->maxUndoSize; tPtr->undo = sharedTextPtr->undo; tPtr->undoTagging = sharedTextPtr->undoTagging; } } /* * Check soft hyphen support. */ |
︙ |
Changes to generic/tkText.h.
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - + | /* * tkText.h -- * * Declarations shared among the files that implement text widgets. * * Copyright (c) 1992-1994 The Regents of the University of California. * Copyright (c) 1994-1995 Sun Microsystems, Inc. |
︙ | |||
1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 | 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 | + | * be cleared, or the user is clearing. */ bool userHasSetModifiedFlag;/* Flag indicating if the user has set the 'modified' flag. * Value 'true' is superseding the computed value, but value * 'false' is only clearing to the initial state of this flag. */ bool undoStackEvent; /* Flag indicating whether <<UndoStack>> is already triggered. */ bool pushSeparator; /* Flag indicating whether a separator has to be pushed before next * insert/delete item. */ bool undoTagging; /* Global default value for TkTextTag::undo. */ unsigned undoLevel; /* The undo level which corresponds to the unmodified state. */ TkTextEditMode lastEditMode;/* Keeps track of what the last edit mode was. */ int lastUndoTokenType; /* Type of newest undo token on stack. */ TkTextTag **undoTagList; /* Array of tags, prepared for undo stack. */ TkTextMarkChange *undoMarkList; /* Array of mark changes, prepared for undo stack. */ uint32_t undoTagListCount; /* Number of entries in array 'undoTagList'. */ |
︙ | |||
1486 1487 1488 1489 1490 1491 1492 | 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 | - + + | * Copies of information from the shared section relating to the editor control mode: */ int steadyMarks; /* false = behavior of original implementation, * true = new editor control mode. */ /* |
︙ |
Changes to generic/tkTextTag.c.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | - + | /* * tkTextTag.c -- * * This module implements the "tag" subcommand of the widget command for * text widgets, plus most of the other high-level functions related to * tags. * * Copyright (c) 1992-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. |
︙ | |||
2021 2022 2023 2024 2025 2026 2027 | 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 | - + - + - - + + | * No existing entry. Create a new one, initialize it, and add a pointer * to it to the hash table entry. */ tagPtr = calloc(1, sizeof(TkTextTag)); tagPtr->name = name; tagPtr->index = index; |
︙ |
Changes to tests/text.test.
︙ | |||
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 | 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 | + + + + + + + + + + + + + + + + + | test text-1.108 {configuration option: "useunibreak"} -setup { text .t pack .t update } -body { .t configure -useunibreak eh } -cleanup { destroy .t } -match glob -returnCodes {error} -result {*} test text-1.109 {configuration option: "undotagging"} -setup { text .t update } -body { .t configure -undotagging 0 .t cget -undotagging } -cleanup { destroy .t } -result {0} test text-1.110 {configuration option: "undotagging"} -setup { text .t update } -body { .t configure -undotagging eh } -cleanup { destroy .t } -match glob -returnCodes {error} -result {*} test text-2.1 {Tk_TextCmd procedure} -body { text } -returnCodes {error} -result {wrong # args: should be "text pathName ?-option value ...?"} |
︙ |
Changes to tests/textTag.test.
︙ | |||
307 308 309 310 311 312 313 314 315 316 317 318 319 320 | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | + + + + + + + + + + + + + + + + + + + | .t tag configure x -underlinecolor [lindex [.t tag configure x -underlinecolor] 3] } -result {red} test textTag-1.37 {configuration options} -body { .t tag configure x -underlinecolor stupid } -cleanup { .t tag configure x -underlinecolor [lindex [.t tag configure x -underlinecolor] 3] } -returnCodes error -result {unknown color name "stupid"} test textTag-1.38 {configuration options} -body { .t tag configure x -undo eh } -cleanup { .t tag configure x -undo 1 } -returnCodes error -result {expected boolean value but got "eh"} test textTag-1.39 {configuration options} -setup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] } -body { .t tag cget x -undo } -result {1} test textTag-1.40 {configuration options} -setup { text .u } -body { .u configure -undotagging 0 .u tag configure x -underline 0 .u tag cget x -undo } -cleanup { destroy .u } -result {0} test textTag-2.1 {TkTextTagCmd - "add" option} -body { .t tag } -returnCodes error -result {wrong # args: should be ".t tag option ?arg arg ...?"} test textTag-2.2 {TkTextTagCmd - "add" option} -body { .t tag gorp |
︙ |