diff options
| -rwxr-xr-x | .fmsbw/10-freebsd14-msys-sciteco | 54 | ||||
| -rwxr-xr-x | .fmsbw/20-freebsd14-osx-sciteco | 7 | ||||
| -rwxr-xr-x | .fmsbw/50-ubuntu22-appimage | 9 | ||||
| -rw-r--r-- | .fmsbw/images/Makefile | 67 | ||||
| -rw-r--r-- | .fmsbw/images/msys-activate | 6 | ||||
| -rw-r--r-- | ChangeLog | 22 | ||||
| -rw-r--r-- | INSTALL | 11 | ||||
| -rw-r--r-- | NEWS | 5 | ||||
| -rw-r--r-- | README | 2 | ||||
| -rw-r--r-- | TODO | 26 | ||||
| -rw-r--r-- | configure.ac | 10 | ||||
| -rw-r--r-- | debian/changelog | 6 | ||||
| -rw-r--r-- | doc/cheat-sheet.mm | 7 | ||||
| -rw-r--r-- | freebsd/Makefile | 2 | ||||
| -rw-r--r-- | freebsd/distinfo | 6 | ||||
| -rw-r--r-- | src/interface-curses/interface.c | 39 | ||||
| -rw-r--r-- | tests/atlocal.in | 2 | ||||
| -rw-r--r-- | www/screenshots.md | 4 |
18 files changed, 197 insertions, 88 deletions
diff --git a/.fmsbw/10-freebsd14-msys-sciteco b/.fmsbw/10-freebsd14-msys-sciteco index 037ac66..f8e1f40 100755 --- a/.fmsbw/10-freebsd14-msys-sciteco +++ b/.fmsbw/10-freebsd14-msys-sciteco @@ -1,39 +1,5 @@ #!/usr/local/bin/bash set -ex -export ASSUME_ALWAYS_YES=yes - -# Already in freebsd14-sciteco -# TODO: Build this with buildah. -# Start with --network=host -#pkg update -#pkg install FreeBSD-clang FreeBSD-clibs-dev \ -# gmake pkgconf autoconf automake libtool \ -# glib gtk3 groff doxygen lowdown valgrind -# -#pkg install llvm21 gnugrep gmake coreutils gsed gawk git wget gnupg bash groff zip autoconf automake libtool python3 -#pkg remove FreeBSD-clang -#git clone https://github.com/HolyBlackCat/quasi-msys2.git /opt/quasi-msys2 -#cd /opt/quasi-msys2 -#ln -s /usr/local/bin/gpgv2 /usr/local/bin/gpgv -#ln -s /usr/local/bin/bash /bin/bash -#mkdir -p gnu-overrides -#ln -s /usr/local/bin/ggrep gnu-overrides/grep -#ln -s /usr/local/bin/gmake gnu-overrides/make -#ln -s /usr/local/bin/gsed gnu-overrides/sed -#ln -s /usr/local/bin/greadlink gnu-overrides/readlink -#ln -s /usr/local/bin/wine64 gnu-overrides/wine -#echo MINGW64 >msystem.txt -#cat >activate << EOF -#cd /opt/quasi-msys2 -#export PATH=`pwd`/gnu-overrides:$PATH -#export PKG_CONFIG=pkg-config -#set +ex -#. env/all.src -#set -ex -#EOF -#gmake install _autotools _gcc _libc++ _glib2 _pdcurses _gtk3 _librsvg -#ln -nfs "/opt/quasi-msys2/root/mingw64" /mingw64 -#pkg clean -a autoreconf -i mkdir build-freebsd @@ -75,7 +41,11 @@ cp ico/sciteco-48.png /opt/htdocs/graphics . /opt/quasi-msys2/activate cd /opt/build -export CURSES_CFLAGS=-I/mingw64/include/pdcurses/ +# NOTE: Sometimes the PDCursesMod MSYS upstream package is too old, +# so we also installed v4.5.4 into the container. +#export CURSES_CFLAGS=-I/mingw64/include/pdcurses/ +export CURSES_CFLAGS=-I/opt/PDCursesMod + # FIXME: glib on MinGW supports static linking but the gspawn # helper binaries are still linked dynamically, forcing us to ship # all DLLs anyway. Therefore it makes little sense to link SciTECO @@ -90,25 +60,31 @@ export LDFLAGS="-flto=thin -stdlib=libc++" # We cannot run Windows binaries automatically through Wine, # so we must still force cross-compilation with --host. +# There is a --with-launcher=wine64, but SciTECO is currently +# simply broken under Wine. #autoreconf -i mkdir build-wingui build-wincon cd build-wingui +# See above, we use a manually built PDCursesMod v4.5.4 +#export CURSES_LIBS="-lpdcurses_wingui -lgdi32 -lcomdlg32 -lwinmm" +export CURSES_LIBS="/opt/PDCursesMod/wingui/pdcurses.a -lgdi32 -lcomdlg32 -lwinmm" ../configure --host=x86_64-w64-mingw32 \ --with-interface=pdcurses-gui --enable-html-docs --program-prefix=g \ --with-scitecodatadir=. \ - --disable-bootstrap \ - CURSES_LIBS="-lpdcurses_wingui -lgdi32 -lcomdlg32 -lwinmm" + --disable-bootstrap make make install-strip #make check TESTSUITEFLAGS="--verbose --color=never" cd ../build-wincon +# See above, we use a manually built PDCursesMod v4.5.4 +#export CURSES_LIBS="-lpdcurses_wincon -lgdi32 -lwinmm" +export CURSES_LIBS="/opt/PDCursesMod/wincon/pdcurses.a -lgdi32 -lwinmm" ../configure --host=x86_64-w64-mingw32 \ --with-interface=pdcurses --enable-html-docs \ --with-scitecodatadir=. \ - --disable-bootstrap \ - CURSES_LIBS="-lpdcurses_wincon -lgdi32 -lwinmm" + --disable-bootstrap make make install-strip #make check TESTSUITEFLAGS="--verbose --color=never" diff --git a/.fmsbw/20-freebsd14-osx-sciteco b/.fmsbw/20-freebsd14-osx-sciteco index bef1cfb..5cbd49f 100755 --- a/.fmsbw/20-freebsd14-osx-sciteco +++ b/.fmsbw/20-freebsd14-osx-sciteco @@ -25,12 +25,14 @@ cd .. #UNATTENDED=1 ./build.sh #unset CPPFLAGS #export MACOSX_DEPLOYMENT_TARGET=10.13 -# FIXME: This is not unattended. Perhaps echo https://nue.de.packages.macports.org/macports/packages >target/macports/MIRROR +# FIXME: This is not unattended. +# Perhaps echo https://nue.de.packages.macports.org/macports/packages >target/macports/MIRROR # dylibbundler is available but can't be run naturally. +# FIXME: How to install variants, like the Quartz variant for Gtk3? #osxcross-macports install --static glib2-devel gtk3-devel # #pkg install cmake -#git clone https://github.com/auriamg/macdylibbundler.git /opt/macdylibbundler +#git clone --depth=1 https://github.com/auriamg/macdylibbundler.git /opt/macdylibbundler #cd /opt/macdylibbundler #cmake . #make @@ -68,6 +70,7 @@ cd .. # FIXME: Also build -arch arm64 and package with x86_64-apple-darwin25-lipo into universal binary. # x86_64-apple-darwin25-lipo -lipo -create -output sciteco x86_64/usr/local/bin/sciteco arm64/usr/local/bin/sciteco # TODO: Build Gtk version as well. +# Currently, we cannot install the Quartz variant. mkdir -p /opt/htdocs/downloads/nightly/ cp sciteco-curses_nightly_macos_x86_64.tar.gz /opt/htdocs/downloads/nightly/ diff --git a/.fmsbw/50-ubuntu22-appimage b/.fmsbw/50-ubuntu22-appimage index ade1100..ca987fa 100755 --- a/.fmsbw/50-ubuntu22-appimage +++ b/.fmsbw/50-ubuntu22-appimage @@ -9,15 +9,6 @@ set -ex # we run this CI job. # We should be fine, though unless committing at 6:00 in the morning. -#apt-get update -o APT::Cache-Start=100000000 -#apt-get install -o APT::Cache-Start=100000000 -y fuse libfuse2 imagemagick wget file binutils libglib2.0-bin -#mkdir -p ~/pkg2appimage -#cd ~/pkg2appimage -#wget -O pkg2appimage.AppImage https://github.com/AppImageCommunity/pkg2appimage/releases/download/continuous/pkg2appimage-1eceb30-x86_64.AppImage -#chmod +x pkg2appimage.AppImage -# FIXME: We could get automatic mounting to work with fusefs in the host and by exposesing /dev/fuse. -#./pkg2appimage.AppImage --appimage-extract - cd AppImage ~/pkg2appimage/squashfs-root/AppRun curses.yml mv out/*.AppImage /opt/htdocs/downloads/nightly/sciteco-curses_nightly_x86_64.AppImage diff --git a/.fmsbw/images/Makefile b/.fmsbw/images/Makefile new file mode 100644 index 0000000..678a05a --- /dev/null +++ b/.fmsbw/images/Makefile @@ -0,0 +1,67 @@ +# Don't build any image by default +all: + +# Base image for building SciTECO on FreeBSD. +freebsd14-sciteco: + buildah from --name $@-working --network=host quay.io/dougrabson/freebsd14.1-small + buildah config --env ASSUME_ALWAYS_YES=yes $@-working + buildah run $@-working pkg update + buildah run $@-working pkg install FreeBSD-clang FreeBSD-lld FreeBSD-libcompiler_rt-dev FreeBSD-clibs-dev \ + gmake pkgconf autoconf automake libtool \ + glib gtk3 groff doxygen lowdown valgrind + buildah run $@-working pkg clean -a + buildah commit $@-working $@ + +freebsd14-msys-sciteco: + buildah from --name $@-working --network=host freebsd14-sciteco + buildah run $@-working pkg install llvm21 gnugrep gmake coreutils gsed gawk \ + git wget gnupg bash groff zip autoconf automake libtool python3 \ + wine + #buildah run $@-working pkg remove FreeBSD-clang + buildah run $@-working pkg clean -a + # Cannot check out with --depth=1 as we need a particular commit. + buildah run $@-working git clone https://github.com/HolyBlackCat/quasi-msys2.git /opt/quasi-msys2 + buildah config --workingdir /opt/quasi-msys2 $@-working + buildah run $@-working git checkout e41c4d0f7dde15031132348875d1d01c8d0ea857 + buildah run $@-working ln -s /usr/local/bin/gpgv2 /usr/local/bin/gpgv + buildah run $@-working ln -s /usr/local/bin/bash /bin/bash + buildah run $@-working mkdir -p gnu-overrides + buildah run $@-working ln -s /usr/local/bin/ggrep gnu-overrides/grep + buildah run $@-working ln -s /usr/local/bin/gmake gnu-overrides/make + buildah run $@-working ln -s /usr/local/bin/gsed gnu-overrides/sed + buildah run $@-working ln -s /usr/local/bin/greadlink gnu-overrides/readlink + buildah run $@-working ln -s /usr/local/bin/wine64 gnu-overrides/wine + buildah run $@-working bash -c 'echo MINGW64 >msystem.txt' + buildah copy $@-working msys-activate activate + buildah run $@-working gmake install _autotools _gcc _libc++ _glib2 _pdcurses _gtk3 _librsvg + buildah run $@-working ln -nfs "/opt/quasi-msys2/root/mingw64" /mingw64 + # The upstream _pdcurses package is often too outdated, so we also build from sources. + # TOOD: Build this with -flto. + buildah run $@-working git clone --depth=1 -b v4.5.4 https://github.com/Bill-Gray/PDCursesMod.git /opt/PDCursesMod + buildah run $@-working bash -c '. /opt/quasi-msys2/activate && gmake -j2 -C /opt/PDCursesMod/wincon CC=$$CC AR=$$AR WIDE=Y UTF8=Y' + buildah run $@-working bash -c '. /opt/quasi-msys2/activate && gmake -j2 -C /opt/PDCursesMod/wingui CC=$$CC AR=$$AR WIDE=Y UTF8=Y' + buildah commit $@-working $@ + +freebsd14-osx-sciteco: + false # TODO + +APT_GET = apt-get -o APT::Cache-Start=100000000 --yes + +ubuntu22-appimage: + buildah from --name $@-working --network=host --os=linux ubuntu:22.04 + buildah run $@-working $(APT_GET) update + buildah run $@-working $(APT_GET) install fuse libfuse2 imagemagick wget file binutils libglib2.0-bin + buildah run $@-working $(APT_GET) clean + buildah run $@-working mkdir -p ~/pkg2appimage + buildah config --workingdir '~/pkg2appimage' $@-working + buildah run $@-working wget -O pkg2appimage.AppImage \ + https://github.com/AppImageCommunity/pkg2appimage/releases/download/continuous/pkg2appimage-1eceb30-x86_64.AppImage + buildah run $@-working chmod +x pkg2appimage.AppImage + # FIXME: We could get automatic mounting to work with fusefs in the host and by exposing /dev/fuse. + # FIXME: This does not run without /proc. + buildah run $@-working ./pkg2appimage.AppImage --appimage-extract + buildah commit $@-working $@ + +# Remove all temporary containers +clean: + buildah rm --all diff --git a/.fmsbw/images/msys-activate b/.fmsbw/images/msys-activate new file mode 100644 index 0000000..655fcae --- /dev/null +++ b/.fmsbw/images/msys-activate @@ -0,0 +1,6 @@ +cd /opt/quasi-msys2 +export PATH=`pwd`/gnu-overrides:$PATH +export PKG_CONFIG=pkg-config +set +ex +. env/all.src +set -ex @@ -6,6 +6,26 @@ using a prebuilt binary) are included. Entries marked with "(!)" might break macro portability compared to the preceding release. +Version 2.5.1 (2026-01-10) +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Haiku is officially supported again from now on +* minor documentation improvement for `ED` +* Curses: The command-line uses the hardware cursor by default now. + To re-enable the self-drawn cursor, do something like + `0,2048ED 2#16@ES/SETCARETSTYLE//$ 2048,0ED` +* PDCurses/XCurses (X11): fixed crashes on startup and mouse support + +Regressions introduced by v2.5.0 and now fixed: + +* GTK: Fixed bogus "(Unnamed)" strings in empty message lines +* PDCurses: Fixed reporting of mouse modifiers (CTRL, ALT, SHIFT) +* PDCurses: Fixed colors + (affects the Windows sciteco.exe and gsciteco.exe). +* PDCurses: Fixed hanging after pressing mouse keys + (affects the Windows sciteco.exe and gsciteco.exe). +* PDCurses/WinGUI: Fixed hanging input (affects gsciteco.exe). + Version 2.5.0 (2026-01-01) ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -115,7 +135,7 @@ Version 2.5.0 (2026-01-01) * implemented ^E<code> string building constructs for embedding bytes and codepoints in a strtoul()-like manner * support <:]q> (pop Q-Register) for getting a success/failure boolean - * support <==> and <===> for printing octal and hexadecimal numbers + * (!) support <==> and <===> for printing octal and hexadecimal numbers * support :=/:==/:=== commands: print number without trailing linefeed * Implemented the <^A> command for printing arbitrary strings. You can use :^A to force raw ANSI output. @@ -3,7 +3,7 @@ Installation Instructions Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -Copyright (C) 2013-2025 Robin Haberkorn +Copyright (C) 2013-2026 Robin Haberkorn Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -26,7 +26,7 @@ SciTECO Build and Runtime Dependencies I recommend ncurses 6.0 or later. * NetBSD Curses (https://github.com/sabotage-linux/netbsd-curses). This is the default on NetBSD. - * PDCursesMod v4.5.1 or later (https://github.com/Bill-Gray/PDCursesMod.git). + * PDCursesMod v4.5.4 or later (https://github.com/Bill-Gray/PDCursesMod.git). This is the recommended flavor of PDCurses to use. * PDCurses/EMCurses (https://github.com/rhaberkorn/emcurses). * PDCurses/XCurses (http://pdcurses.sourceforge.net/). @@ -47,7 +47,7 @@ installed by the user manually: * Scintilla (v5.3.0 or later): http://www.scintilla.org/ * When choosing the Curses interface: - * Scinterm (v5.2 or later): + * Scinterm (v5.5 or later): http://foicica.com/scinterm/ * Lexilla (v5.0.0 or later, optional): https://www.scintilla.org/Lexilla.html @@ -75,6 +75,11 @@ On NetBSD: $ sudo pkgin install git gmake pkg-config autoconf automake libtool-base \ glib2 gtk3+ doxygen +On Haiku: + + $ pkgman install git make pkgconfig autoconf automake libtool \ + glib2_devel ncurses6_devel gtk3_devel groff doxygen + Building from Source Tar Ball or Repository =========================================== @@ -2,6 +2,11 @@ News ==== <span class="nf nf-md-new_box"></span> +SciTECO [v2.5.1](https://sciteco.fmsbw.de/downloads/v2.5.1/) has been released. +This is a hotfix release to v2.5.0, which first and foremost fixes the +Windows PDCurses builds. + +<span class="nf nf-md-new_box"></span> SciTECO [v2.5.0](https://sciteco.fmsbw.de/downloads/v2.5.0/) has been released. This release brings many new features, but most importantly makes the language much more usable as a non-interactive scripting language. @@ -27,7 +27,7 @@ All X/Open-compatible libraries should be supported. SVr4 curses without enhanced definitions is **not** supported. Linux, FreeBSD, NetBSD, [Mac OS X](https://sciteco.fmsbw.de/knowledge/Mac%20OS%20Support), -Windows (MinGW 32/64) ~~and [Haiku](https://www.haiku-os.org/) (gcc4)~~ are tested and supported. +Windows (MinGW 32/64) and [Haiku](https://www.haiku-os.org/) (gcc4) are tested and supported. SciTECO compiles with both GCC and Clang. SciTECO should compile just fine on other UNIX-compatible platforms. However UNIX-compatibility is not strictly required: @@ -2,6 +2,7 @@ Tasks: * Have a look at TECO-86. * VEDIT and PMATE for MS-DOS * Scintilla: upstream 2 patches + * HaikuPorts Known Bugs: * OBS GTK builds sometimes fail: "cannot open display" @@ -28,6 +29,9 @@ Known Bugs: This would be necessary for an interactive screen editing script, that leaves you in <I> always. This would require some refactoring. + * GTK on Haiku: CTRL and AltGr-combinations do not work. + The modifiers are not delivered properly and it appears to affect all Gtk apps + on Haiku. * Gtk: The control characters in tutorial.woman are still styled with the variable-width font since its rendered in STYLE_CONTROLCHAR (36), which is reset in woman.tes. @@ -42,15 +46,6 @@ Known Bugs: In some cases, the internal redrawing blocks SciTECO forever. * @ES/SCI_CLEARALLREPRESENTATIONS// does nothing. Might be a Scintilla bug. - * PDCurses/Wincon does not report button released events. - We try to work around this with click detection, - but it still behaves a bit oddly. - See https://github.com/Bill-Gray/PDCursesMod/issues/330 - Waiting for PDCurses in MSYS to be updated. - * PDCurses/WinGUI: There is still some flickering, but it got better - since key macros update the command line only once. - Could already be fixed upstream, see: - https://github.com/Bill-Gray/PDCursesMod/issues/322 * Win32: Interrupting <EC> will sometimes hang. Affects both PDCurses/WinGUI and Gtk. This no longer happens with ECbash -c 'while true; do true; done'$. @@ -59,15 +54,6 @@ Known Bugs: However the UNIX path translation appears to be a Cygwin feature. If SciTECO would do that, it might break other things (e.g. you might want to refer directory C:\mingw64 instead). - * Win32/Wincon: cat ... | sciteco -i - "Redirection is not supported." - PR: https://github.com/Bill-Gray/PDCursesMod/pull/344 - Waiting for an MSYS package releae. - * PDCurses/Win32: Both Wincon and WinGUI crash when you press *any* - non-ANSI character. This is fixed since PDCurses v4.5.2: - https://github.com/Bill-Gray/PDCursesMod/issues/335 - We're waiting for an MSYS package upgrade. - It could also be worked around by using wget_wch() instead of wgetch(). * PDCurses/Win32: Crashes sometimes without any error message. * NetBSD Curses: scrolling apparently uses hardware idl capabilities resulting in graphical glitches on slow terminals. @@ -801,6 +787,10 @@ Features: * There could be a key macro script for my Russian-phonetic keyboard layout. This would probably require some new key macro states as well. + * Allow the hardware cursor (CARETSTYLE_CURSES) on the main view as well. + We'd have to handle an overlapping info popup, though. + Should we deactivate the hardware cursor via curs_set(0) if it overlaps + the popup? Optimizations: * Use SC_DOCUMENTOPTION_STYLES_NONE in batch mode. diff --git a/configure.ac b/configure.ac index 460862c..ed5e056 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) -AC_INIT([SciTECO], [2.5.0], +AC_INIT([SciTECO], [2.5.1], [hackers@fmsbw.de], [sciteco], [https://sciteco.fmsbw.de/]) @@ -458,7 +458,13 @@ AC_ARG_ENABLE(malloc-replacement, [Replace the libc malloc() [default=check]]), [malloc_replacement=$enableval], [malloc_replacement=check]) if [[ $malloc_replacement = check ]]; then - # We currently do not support dlmalloc on Windows and Mac OS. + # malloc() replacement via dlmalloc should work practically everywhere + # but does not extend to shared libraries on Windows and Mac OS. + # That's why it is disabled by default on Windows and Mac OS where other cheap ways + # of introspection are available (see memory.c). + # On the remaining platforms you can try to combine --enable-malloc-replacement + # with --enable-static-executables to link in as many libraries statically + # as possible. case $host in *-*-darwin* | *-mingw*) malloc_replacement=no;; *) malloc_replacement=yes;; diff --git a/debian/changelog b/debian/changelog index 0923f61..ddea47c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sciteco (2.5.1) unstable; urgency=low + + * new upstream version v2.5.1 + + -- Robin Haberkorn <rhaberkorn@fmsbw.de> Sat, 10 Jan 2026 15:16:39 +0000 + sciteco (2.5.0-0) unstable; urgency=low * new upstream version v2.5.0 diff --git a/doc/cheat-sheet.mm b/doc/cheat-sheet.mm index ba7247c..9a63f4e 100644 --- a/doc/cheat-sheet.mm +++ b/doc/cheat-sheet.mm @@ -825,7 +825,12 @@ Binary negate \fIn\fP \(em negate TECO boolean. . TD . CI "" n = . TD -Show value of \fIn\fP in message line. +Show value of \fIn\fP in message line (decimal). +. TRX +. TD +. CI "" n === +. TD +Show value of \fIn\fP in message line (hexadecimal). . TRX . TD colspan=2 Q-Registers consist of 2 cells: strings and integers. diff --git a/freebsd/Makefile b/freebsd/Makefile index 1dcd194..e18b7bc 100644 --- a/freebsd/Makefile +++ b/freebsd/Makefile @@ -1,5 +1,5 @@ PORTNAME= sciteco -DISTVERSION= 2.5.0 +DISTVERSION= 2.5.1 CATEGORIES= editors textproc devel MASTER_SITES= https://sciteco.fmsbw.de/downloads/v${DISTVERSION}/ \ SOURCEFORGE/${PORTNAME}/v${DISTVERSION}/ diff --git a/freebsd/distinfo b/freebsd/distinfo index 49a7b48..65d7d37 100644 --- a/freebsd/distinfo +++ b/freebsd/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1745085748 -SHA256 (sciteco-2.4.0.tar.gz) = 5b053644d8365eb0fddd9b268af9d6c6c44786dfa51dd4cbb962abac66670402 -SIZE (sciteco-2.4.0.tar.gz) = 4077220 +TIMESTAMP = 1768082190 +SHA256 (sciteco-2.5.1.tar.gz) = cc99c6855f844f0514f2ed4879bf6a02f11eb489a3b77d88ad7f0bcfe1379fbf +SIZE (sciteco-2.5.1.tar.gz) = 4118025 diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index 9ace2ee..94501cb 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -395,6 +395,13 @@ teco_view_noutrefresh(teco_view_t *ctx) scintilla_noutrefresh(ctx); } +static inline void +teco_view_update_cursor(teco_view_t *ctx) +{ + if (teco_view_ssm(ctx, SCI_GETCARETSTYLE, 0, 0) & CARETSTYLE_CURSES) + scintilla_update_cursor(ctx); +} + static inline WINDOW * teco_view_get_window(teco_view_t *ctx) { @@ -445,6 +452,10 @@ teco_interface_init(void) * Instead we use INDIC_SQUIGGLE, which is rendered as A_UNDERLINE. */ teco_cmdline_ssm(SCI_INDICSETSTYLE, INDICATOR_RUBBEDOUT, INDIC_SQUIGGLE); + /* + * Enable hardware cursor by default. + */ + teco_cmdline_ssm(SCI_SETCARETSTYLE, CARETSTYLE_CURSES, 0); /* * On all platforms except Curses/XTerm, it's @@ -784,8 +795,6 @@ teco_interface_init_interactive(GError **error) cbreak(); noecho(); - /* Scintilla draws its own cursor */ - curs_set(0); /* * This has also been observed to reduce flickering * in teco_interface_refresh(). @@ -1828,6 +1837,16 @@ teco_interface_refresh(gboolean force) clearok(curscr, TRUE); /* + * Let Scinterm enable/disable the hardware cursor + * based on the CARETSTYLE_CURSES. + * Doing this repeatedly ensures you can change the + * caret style interactively. + * Also, window resizes enable the cursor on PDCurses/wincon + * sometimes (FIXME). + */ + curs_set(0); + + /* * Info window is updated very often which is very * costly, especially when using PDC_set_title(), * so we redraw it here, where the overhead does @@ -1839,6 +1858,17 @@ teco_interface_refresh(gboolean force) wnoutrefresh(teco_interface.msg_window); teco_view_noutrefresh(teco_cmdline.view); teco_curses_info_popup_noutrefresh(&teco_interface.popup); + /* + * If hardware cursors (CARETSTYLE_CURSES) are enabled on the + * command-line view, make sure that the cursor is left + * in the correct position. + * + * FIXME: This shouldn't be necessary if we refreshed the command-line + * view last. Also, if we wanted to support the hardware cursor + * in the main view as well, we'd have to handle a possibly + * overlappig info popup. + */ + teco_view_update_cursor(teco_cmdline.view); doupdate(); } @@ -2115,11 +2145,6 @@ teco_interface_event_loop_iter(void) return; #ifdef KEY_RESIZE case KEY_RESIZE: - /* - * At least on PDCurses/Wincon, the hardware cursor is sometimes - * reactivated. - */ - curs_set(0); teco_interface_resize_all_windows(); break; #endif diff --git a/tests/atlocal.in b/tests/atlocal.in index b2ceda1..81dc1fb 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -40,4 +40,4 @@ esac # Default stack size on Linux (8M). # Some platforms allow very large stack sizes, making it hard to test # against potential stack overflows. -ulimit -s 8192 +ulimit -s 8192 || true diff --git a/www/screenshots.md b/www/screenshots.md index df8925a..471374e 100644 --- a/www/screenshots.md +++ b/www/screenshots.md @@ -1,5 +1,9 @@ # Screenshots +## v2.5.1 + + + ## v2.4.0  |
