ADDED .github/workflows/onefiledist.yml Index: .github/workflows/onefiledist.yml ================================================================== --- /dev/null +++ .github/workflows/onefiledist.yml @@ -0,0 +1,223 @@ +name: Build Binaries +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + - "bug-57b821d2db" + tags: + - "core-**" +permissions: + contents: read +jobs: + linux: + name: Linux + runs-on: ubuntu-20.04 + defaults: + run: + shell: bash + env: + CC: gcc + CFGOPT: --disable-symbols --disable-shared + steps: + - name: Checkout Tk + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl 8.7 + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-branch + path: tcl + - name: Setup Environment + run: | + sudo apt-get install libxss-dev libxft-dev + touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c + touch tk/generic/tkStubInit.c + echo "INST_DIR=$(cd install;pwd)" >> $GITHUB_ENV + echo "VER_PATH=$(cd tcl/tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV + working-directory: "." + - name: Configure Tcl + run: | + ./configure $CFGOPT --prefix=$INST_DIR + working-directory: tcl/unix + - name: Build & Install Tcl + run: | + make binaries libraries install + make shell SCRIPT="$VER_PATH $GITHUB_ENV" + working-directory: tcl/unix + - name: Configure Tk + run: | + ./configure $CFGOPT --with-tcl=$INST_DIR/lib --prefix=$INST_DIR + working-directory: tk/unix + - name: Build & Install Tk + run: | + make binaries libraries install + working-directory: tk/unix + # TODO: need the Tk version separately for distro naming below + - name: Package + run: | + cp bin/wish8.6 ${BUILD_NAME} + chmod +x ${BUILD_NAME} + tar -cf ${BUILD_NAME}.tar ${BUILD_NAME} + working-directory: ${{ env.INST_DIR }} + env: + BUILD_NAME: wish${{ env.TCL_PATCHLEVEL }}_snapshot + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: Wish ${{ env.TCL_PATCHLEVEL }} Linux single-file build (snapshot) + path: ${{ env.INST_DIR }}/*.tar + - name: Describe Installation Zip Contents + if: ${{ always() }} + run: | + unzip -l wish${{ env.TCL_PATCHLEVEL }}_snapshot || true + working-directory: ${{ env.INST_DIR }} + macos: + name: macOS + runs-on: macos-11 + defaults: + run: + shell: bash + env: + CC: gcc + CFGOPT: --disable-symbols --disable-shared + steps: + - name: Checkout Tk + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl 8.7 + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-branch + path: tcl + - name: Checkout create-dmg + uses: actions/checkout@v4 + with: + repository: create-dmg/create-dmg + ref: v1.0.8 + path: create-dmg + - name: Setup Environment + run: | + mkdir -p install/contents + touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c + touch tk/generic/tkStubInit.c + echo "INST_DIR=$(cd install;pwd)" >> $GITHUB_ENV + echo "VER_PATH=$(cd tcl/tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV + echo "CREATE_DMG=$(cd create-dmg;pwd)/create-dmg" >> $GITHUB_ENV + echo "CFLAGS=-arch x86_64 -arch arm64" >> $GITHUB_ENV + working-directory: "." + - name: Configure Tcl + run: | + ./configure $CFGOPT --prefix=$INST_DIR + working-directory: tcl/unix + - name: Build & Install Tcl + run: | + make binaries libraries install + make shell SCRIPT="$VER_PATH $GITHUB_ENV" + working-directory: tcl/unix + - name: Configure Tk + run: | + ./configure $CFGOPT --with-tcl=$INST_DIR/lib --prefix=$INST_DIR \ + --enable-aqua + working-directory: tk/unix + - name: Build & Install Tk + run: | + make binaries libraries install + working-directory: tk/unix + # TODO: need the Tk version separately for distro naming below + - name: Package + run: | + cp ../tk/unix/wish contents/${BUILD_NAME} + chmod +x contents/${BUILD_NAME} + cat > contents/README.txt <> $GITHUB_ENV + echo "VER_PATH=$(cd tcl/tools; pwd)/addVerToFile.tcl" >> $GITHUB_ENV + working-directory: "." + - name: Configure Tcl + run: | + ./configure $CFGOPT --prefix=$INST_DIR + working-directory: tcl/win + - name: Build & Install Tcl + run: | + make binaries libraries install + $INST_DIR/bin/tclsh* $VER_PATH $GITHUB_ENV + working-directory: tcl/win + - name: Configure Tk + run: | + ./configure $CFGOPT --with-tcl=$INST_DIR/lib --prefix=$INST_DIR + working-directory: tk/win + - name: Build & Install Tk + run: | + make all install + echo "TK_BIN=`pwd`/`echo wish*.exe`" >> $GITHUB_ENV + working-directory: tk/win + # TODO: need the Tk version separately for distro naming below + - name: Package + run: | + cp ${TK_BIN} combined/${BUILD_NAME}.exe + working-directory: install + env: + BUILD_NAME: wish${{ env.TCL_PATCHLEVEL }}_snapshot + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: Wish ${{ env.TCL_PATCHLEVEL }} Windows single-file build (snapshot) + path: install/combined/wish${{ env.TCL_PATCHLEVEL }}_snapshot.exe Index: doc/text.n ================================================================== --- doc/text.n +++ doc/text.n @@ -227,11 +227,12 @@ . Indicates the end of the text (the character just after the last newline). .TP 12 \fImark\fR . -Indicates the character just after the mark whose name is \fImark\fR. +Indicates the character just after the mark whose name is \fImark\fR (see +\fBMARKS\fR for details). .TP 12 \fItag\fB.first\fR . Indicates the first character in the text that has been tagged with \fItag\fR. This form generates an error if no characters are currently tagged with Index: generic/tkTextIndex.c ================================================================== --- generic/tkTextIndex.c +++ generic/tkTextIndex.c @@ -2436,10 +2436,13 @@ segPtr->body.chars)); } firstChar = 0; } if (offset == 0) { + if (indexPtr->byteIndex == 0) { + goto done; + } if (modifier == TKINDEX_DISPLAY) { TkTextIndexBackChars(textPtr, indexPtr, 1, indexPtr, COUNT_DISPLAY_INDICES); } else { TkTextIndexBackChars(NULL, indexPtr, 1, indexPtr, @@ -2448,13 +2451,10 @@ } else { indexPtr->byteIndex -= chSize; } offset -= chSize; if (offset < 0) { - if (indexPtr->byteIndex == 0) { - goto done; - } segPtr = TkTextIndexToSeg(indexPtr, &offset); } } if (!firstChar) { Index: tests/textIndex.test ================================================================== --- tests/textIndex.test +++ tests/textIndex.test @@ -939,10 +939,20 @@ test textIndex-22.15 {text index display wordstart} { catch {destroy .t} text .t .t index "1.0 display wordstart" ; # used to crash } 1.0 +test textIndex-22.16 {text index wordstart, bug [57b821d2db]} { + catch {destroy .t} + text .t + .t insert 1.0 " 123 5 789012 LINE-1\n\n 123 5 789000 LINE-3\n\n0123 5 789012 LINE-5" + set res [.t index "1.1 wordstart"] + lappend res [.t index "5.0 wordstart"] + .t mark set insert 1.1 + lappend res [.t index "insert wordstart"] + lappend res [.t index "5.1 wordstart"] +} {1.1 5.0 1.1 5.0} test textIndex-23.1 {text paragraph start} { pack [text .t2] .t2 insert end " Text" set res 2.0