summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-01-25 13:55:34 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-01-25 13:55:34 (GMT)
commit8f78c04f27c6531c1dd122dfeded9c377aa6b494 (patch)
tree20ca3c2c18188d736fec1c60cf89eb085c75efce /generic
parent662480c9ebe208020fd0484bbd7908dbb0fa7562 (diff)
downloadtk-8f78c04f27c6531c1dd122dfeded9c377aa6b494.zip
tk-8f78c04f27c6531c1dd122dfeded9c377aa6b494.tar.gz
tk-8f78c04f27c6531c1dd122dfeded9c377aa6b494.tar.bz2
Fixed disappearing cursor when moving up one line at the boundary of elided lines. Factorized the code again in the process, using function IsStartOfNotMergedLine when possible.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 34202bd..e21b76b 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4668,12 +4668,11 @@ TextChanged(
*/
rounded = *index1Ptr;
- do {
- rounded.byteIndex = 0;
+ rounded.byteIndex = 0;
+ notBegin = 0;
+ while (!IsStartOfNotMergedLine(textPtr, &rounded) && notBegin) {
notBegin = !TkTextIndexBackBytes(textPtr, &rounded, 1, &rounded);
- } while (TkTextIsElided(textPtr, &rounded, NULL) && notBegin);
- if (notBegin) {
- TkTextIndexForwBytes(textPtr, &rounded, 1, &rounded);
+ rounded.byteIndex = 0;
}
/*
@@ -4703,14 +4702,11 @@ TextChanged(
}
rounded.linePtr = linePtr;
rounded.byteIndex = 0;
- TkTextIndexBackBytes(textPtr, &rounded, 1, &rounded);
- } while (TkTextIsElided(textPtr, &rounded, NULL));
+ } while (!IsStartOfNotMergedLine(textPtr, &rounded));
if (linePtr == NULL) {
lastPtr = NULL;
} else {
- TkTextIndexForwBytes(textPtr, &rounded, 1, &rounded);
-
/*
* 'rounded' now points to the start of a display line as well as the
* start of a logical line not merged with its previous line, and