summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-03-27 15:00:58 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-03-27 15:00:58 (GMT)
commit1b8e0125b84845a3b0ba6b69d6c4894aa15627f2 (patch)
tree7f9a17de7e17f122a974dd8cd88d89e943a8db59 /generic
parent1481905e743ebc704ff8cae77fa26c360b99c336 (diff)
downloadtk-1b8e0125b84845a3b0ba6b69d6c4894aa15627f2.zip
tk-1b8e0125b84845a3b0ba6b69d6c4894aa15627f2.tar.gz
tk-1b8e0125b84845a3b0ba6b69d6c4894aa15627f2.tar.bz2
Beginning of fix for [18c08df753] - Reverted [296bd4c3], and adjusted textDisp-4.9 accordingly by adding one fixedHeight on the two necessary places in the test result
Diffstat (limited to 'generic')
-rw-r--r--generic/tkText.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 341ec0f..4942913 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -3003,9 +3003,11 @@ DeleteIndexRange(
* The code below is ugly, but it's needed to make sure there is always a
* dummy empty line at the end of the text. If the final newline of the
* file (just before the dummy line) is being deleted, then back up index
- * to just before the newline. Furthermore, remove any tags that are
- * present on the newline that isn't going to be deleted after all (this
- * simulates deleting the newline and then adding a "clean" one back
+ * to just before the newline. If there is a newline just before the first
+ * character being deleted, then back up the first index too, so that an
+ * even number of lines gets deleted. Furthermore, remove any tags that
+ * are present on the newline that isn't going to be deleted after all
+ * (this simulates deleting the newline and then adding a "clean" one back
* again). Note that index1 and index2 might now be equal again which
* means that no text will be deleted but tags might be removed.
*/
@@ -3020,6 +3022,10 @@ DeleteIndexRange(
oldIndex2 = index2;
TkTextIndexBackChars(NULL, &oldIndex2, 1, &index2, COUNT_INDICES);
line2--;
+ if ((index1.byteIndex == 0) && (line1 != 0)) {
+ TkTextIndexBackChars(NULL, &index1, 1, &index1, COUNT_INDICES);
+ line1--;
+ }
arrayPtr = TkBTreeGetTags(&index2, NULL, &arraySize);
if (arrayPtr != NULL) {
for (i = 0; i < arraySize; i++) {