summaryrefslogtreecommitdiffstats
path: root/generic/tkTextIndex.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-07-12 16:26:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-07-12 16:26:03 (GMT)
commit308c4fa18ac164fca1522a81c09760cd3e417799 (patch)
tree71ccd63ec1e2dd5dba1c5723f6daed92a27d71c9 /generic/tkTextIndex.c
parentcc1227d6d930a024f7b8ce22f70265a2020f625d (diff)
parented381a36648ee0c9050e7bcd0a44e92f295d21ff (diff)
downloadtk-308c4fa18ac164fca1522a81c09760cd3e417799.zip
tk-308c4fa18ac164fca1522a81c09760cd3e417799.tar.gz
tk-308c4fa18ac164fca1522a81c09760cd3e417799.tar.bz2
Fix Tk_ObjCustomOption documentation. Fix some indenting
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r--generic/tkTextIndex.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 4acad9d..a77fd9a 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -45,8 +45,8 @@ static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr,
TkText *textPtr, const char *string,
TkTextIndex *indexPtr, int *canCachePtr);
static int IndexCountBytesOrdered(const TkText *textPtr,
- const TkTextIndex *indexPtr1,
- const TkTextIndex *indexPtr2);
+ const TkTextIndex *indexPtr1,
+ const TkTextIndex *indexPtr2);
/*
* The "textindex" Tcl_Obj definition:
@@ -1379,7 +1379,7 @@ ForwBack(
} else {
TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, &xOffset);
while (count-- > 0) {
- TkTextIndex indexPtr2;
+ TkTextIndex indexPtr2;
/*
* Go to the beginning of the line, then backward one
@@ -1390,20 +1390,20 @@ ForwBack(
TkTextIndexBackChars(textPtr, indexPtr, 1, &indexPtr2,
COUNT_DISPLAY_INDICES);
- /*
- * If we couldn't go to the previous line, then we wanted
- to go before the start of the text: arrange for returning
- the first index of the first display line.
- */
-
- if (!TkTextIndexCmp(indexPtr, &indexPtr2)) {
- xOffset = 0;
- break;
- }
- *indexPtr = indexPtr2;
+ /*
+ * If we couldn't go to the previous line, then we wanted
+ to go before the start of the text: arrange for returning
+ the first index of the first display line.
+ */
+
+ if (!TkTextIndexCmp(indexPtr, &indexPtr2)) {
+ xOffset = 0;
+ break;
+ }
+ *indexPtr = indexPtr2;
}
}
- TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, NULL);
+ TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, NULL);
/*
* This call assumes indexPtr is the beginning of a display line
@@ -1749,7 +1749,7 @@ IndexCountBytesOrdered(
TkTextLine *linePtr;
if (indexPtr1->linePtr == indexPtr2->linePtr) {
- return indexPtr2->byteIndex - indexPtr1->byteIndex;
+ return indexPtr2->byteIndex - indexPtr1->byteIndex;
}
/*
@@ -1763,19 +1763,19 @@ IndexCountBytesOrdered(
segPtr1 = TkTextIndexToSeg(indexPtr1, &offset);
byteCount = -offset;
for (segPtr = segPtr1; segPtr != NULL; segPtr = segPtr->nextPtr) {
- byteCount += segPtr->size;
+ byteCount += segPtr->size;
}
linePtr = TkBTreeNextLine(textPtr, indexPtr1->linePtr);
while (linePtr != indexPtr2->linePtr) {
for (segPtr = linePtr->segPtr; segPtr != NULL;
- segPtr = segPtr->nextPtr) {
- byteCount += segPtr->size;
- }
- linePtr = TkBTreeNextLine(textPtr, linePtr);
- if (linePtr == NULL) {
- Tcl_Panic("TextIndexCountBytesOrdered ran out of lines");
- }
+ segPtr = segPtr->nextPtr) {
+ byteCount += segPtr->size;
+ }
+ linePtr = TkBTreeNextLine(textPtr, linePtr);
+ if (linePtr == NULL) {
+ Tcl_Panic("TextIndexCountBytesOrdered ran out of lines");
+ }
}
byteCount += indexPtr2->byteIndex;