diff options
author | fvogelnew1@free.fr <fvogel> | 2016-02-08 20:13:20 (GMT) |
---|---|---|
committer | fvogelnew1@free.fr <fvogel> | 2016-02-08 20:13:20 (GMT) |
commit | b66055a2818a05efbcce9bb2ceb6bb6c8b67ba24 (patch) | |
tree | 8a1d42fdc842eba46c53531c751a9151299f71e8 /generic | |
parent | 0c241e6ab7d051358e1689d836430a3508a65a45 (diff) | |
download | tk-b66055a2818a05efbcce9bb2ceb6bb6c8b67ba24.zip tk-b66055a2818a05efbcce9bb2ceb6bb6c8b67ba24.tar.gz tk-b66055a2818a05efbcce9bb2ceb6bb6c8b67ba24.tar.bz2 |
More comments in FindDLine, with slightly optimized code to achieve the same functionality.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTextDisp.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c5ad36b..d45ac73 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -6618,17 +6618,25 @@ FindDLine( /* * We're past the last display line, either because the desired * index lies past the visible text, or because the desired index - * is on the last display line showing the last logical line. + * is on the last display line. */ indexPtr2 = dlPtrPrev->index; TkTextIndexForwBytes(textPtr, &indexPtr2, dlPtrPrev->byteCount, &indexPtr2); if (TkTextIndexCmp(&indexPtr2,indexPtr) > 0) { + /* + * The desired index is on the last display line. + * --> return this display line. + */ dlPtr = dlPtrPrev; - break; } else { - return NULL; + /* + * The desired index is past the visible text. There is no + * display line displaying something at the desired index + * --> return NULL. + */ } + break; } if (TkTextIndexCmp(&dlPtr->index,indexPtr) > 0) { dlPtr = dlPtrPrev; |