From 7032bd218262ac1f38fbddfc02e685bbee0c0ac2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Feb 2024 08:31:36 +0000 Subject: Add test textIndex-22.16 demonstrating bug [57b821d2db]. Currently fails (expectedly). --- tests/textIndex.test | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/textIndex.test b/tests/textIndex.test index 2b652b4..9b49cf1 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -941,6 +941,15 @@ test textIndex-22.15 {text index display wordstart} { 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" + .t mark set insert end + set res [.t index "1.1 wordstart"] + .t mark set insert 1.1 + lappend res [.t index "1.1 wordstart"] +} {2.1 2.1} test textIndex-23.1 {text paragraph start} { pack [text .t2] -- cgit v0.12 From 741e561bf1a9018ec741c6a638a73136ca56021c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Feb 2024 11:05:05 +0000 Subject: Make textIndex-22.16 really fail. --- tests/textIndex.test | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/textIndex.test b/tests/textIndex.test index 9b49cf1..2a7b98f 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -944,12 +944,13 @@ test textIndex-22.15 {text index display wordstart} { 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" - .t mark set insert end - set res [.t index "1.1 wordstart"] + .t insert 1.0 " 123 5 789012 LINE-1\n\n 123 5 789000 LINE-3\n\n0123 5 789012 LINE-5" + pack .t + update + set res [.t index "5.0 wordstart"] .t mark set insert 1.1 - lappend res [.t index "1.1 wordstart"] -} {2.1 2.1} + lappend res [.t index "insert wordstart"] +} {5.0 1.1} test textIndex-23.1 {text paragraph start} { pack [text .t2] -- cgit v0.12 From 3b3f7ed808224bd5ca953b2ea16409be56195438 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Feb 2024 11:05:54 +0000 Subject: Fix [57b821d2db]: text index {insert wordstart} fails at 0 and 1 word start positions. --- generic/tkTextIndex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index cb7ba7b..272f234 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -2438,6 +2438,9 @@ StartEnd( firstChar = 0; } if (offset == 0) { + if (indexPtr->byteIndex == 0) { + goto done; + } if (modifier == TKINDEX_DISPLAY) { TkTextIndexBackChars(textPtr, indexPtr, 1, indexPtr, COUNT_DISPLAY_INDICES); @@ -2450,9 +2453,6 @@ StartEnd( } offset -= chSize; if (offset < 0) { - if (indexPtr->byteIndex == 0) { - goto done; - } segPtr = TkTextIndexToSeg(indexPtr, &offset); } } -- cgit v0.12 From 44e42539f1e18a0cd43eeb0ae70083037bdd3f1e Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Feb 2024 11:25:01 +0000 Subject: The text widget does not need to be packed for test textIndex-22.16. --- tests/textIndex.test | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/textIndex.test b/tests/textIndex.test index 2a7b98f..8fcba28 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -945,8 +945,6 @@ 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" - pack .t - update set res [.t index "5.0 wordstart"] .t mark set insert 1.1 lappend res [.t index "insert wordstart"] -- cgit v0.12 From 17e4c2107a153a4fd32578599709cfacfe2d9b01 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 3 Feb 2024 17:46:20 +0000 Subject: Expand coverage of textIndex-22.16 --- tests/textIndex.test | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/textIndex.test b/tests/textIndex.test index 8fcba28..558a9aa 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -945,10 +945,12 @@ 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 "5.0 wordstart"] + 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"] -} {5.0 1.1} + 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] -- cgit v0.12 From 431d4aca9ac77d77fc998142b8df0b159039b794 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 5 Feb 2024 20:13:51 +0000 Subject: Add a link to the 'MARKS' section in text.n --- doc/text.n | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/text.n b/doc/text.n index e4bc64d..fa00af7 100644 --- a/doc/text.n +++ b/doc/text.n @@ -229,7 +229,8 @@ 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 . -- cgit v0.12 From 1d82991074afb4cb53f360a86145bea473c56669 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 6 Feb 2024 20:53:25 +0000 Subject: Build binaries at GitHub. --- .github/workflows/onefiledist.yml | 223 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 .github/workflows/onefiledist.yml diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml new file mode 100644 index 0000000..3f669a0 --- /dev/null +++ b/.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.6 + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-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.6 + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-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 -- cgit v0.12 From 768c0b2d12422d374618b4f900c6c8f27f4f0202 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 7 Feb 2024 20:27:53 +0000 Subject: Fix previous commit. --- .github/workflows/onefiledist.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/onefiledist.yml b/.github/workflows/onefiledist.yml index 3f669a0..b382e0d 100644 --- a/.github/workflows/onefiledist.yml +++ b/.github/workflows/onefiledist.yml @@ -25,11 +25,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 8.6 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-6-branch + ref: core-8-branch path: tcl - name: Setup Environment run: | @@ -89,11 +89,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 8.6 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-6-branch + ref: core-8-branch path: tcl - name: Checkout create-dmg uses: actions/checkout@v4 @@ -177,11 +177,11 @@ jobs: uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 8.6 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: core-8-6-branch + ref: core-8-branch path: tcl - name: Setup Environment run: | -- cgit v0.12