diff options
author | fvogel <fvogelnew1@free.fr> | 2015-01-25 13:55:34 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-01-25 13:55:34 (GMT) |
commit | 66c7b91f6e33f0c67be2daa3ead0ee6526981f26 (patch) | |
tree | 20ca3c2c18188d736fec1c60cf89eb085c75efce /generic | |
parent | 936e38c7360b67f7e3f2a1d4c7066842e0082737 (diff) | |
download | tk-66c7b91f6e33f0c67be2daa3ead0ee6526981f26.zip tk-66c7b91f6e33f0c67be2daa3ead0ee6526981f26.tar.gz tk-66c7b91f6e33f0c67be2daa3ead0ee6526981f26.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.c | 14 |
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 |