aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
33 hoursdon't crash on `0S...$`, but always throw an errormaster-fmsbw-ciRobin Haberkorn2-3/+15
* This has been broken for some time, but it didn't crash in v2.5.2. * Even when it did not crash, the search just failed. In TECO-11 (judging by TECOC), we must throw an error, though. Video TECO on the other hand always succeeds in such cases. * Added test case
33 hours.fmsbw/50-ubuntu22-appimage: hopefully fixed AppImage buildsRobin Haberkorn1-0/+1
I am unsure why it now suddenly causes problems. pkg2appimage appears to download the appimagetool.
41 hours.fmsbw/10-freebsd14-msys-sciteco: use wine64.bin instead of wine64Robin Haberkorn1-3/+3
wine64 nowadays appears to require a 32-bit Wine as well, so replace it with wine64.bin. The quasi-msys2 python3 could theoretically also be launched with wine64.bin, but I prefer to run it with the FreeBSD-native python3.
2 days.fmsbw/10-freebsd14-msys-sciteco: fixed bundling DLLsRobin Haberkorn1-3/+9
quasi-msys2 apparently overwrites python3 with a win32 version. This no longer works without installing a 32-bit Wine version. Instead, I now force it to run with the native FreeBSD python3.
3 daysterex: fixed tarballs (`make dist` and `make distcheck`)Robin Haberkorn1-0/+0
It was missing a few files. Should also fix CI runs.
3 days.fmsbw/10-freebsd14-msys-sciteco: fixed building with ↵Robin Haberkorn1-2/+2
--disable-malloc-replacement sys/user.h draws in some header from openbsm, so we install it as well into the freebsd14-sciteco container. Should fix CI builds.
4 daysfixed dot after an unsuccessful interactive searchRobin Haberkorn2-20/+29
If you had a partial success during interactive searching, dot would be left at that position since the failure handling only reset via SCI_GOTOPOS. This is now fixed by restoring the initial dot in glyphs as well. All existing occurrences of "dot" have been renamed to "pos" for consistency. (Nowadays, "dot" should be reserved for glyph positions since this is what `.` returns. Especially if both kinds of positions are used in the same code.) A test case has been added. This has been broken since 685507922b0b75da5935076395a5b1ec1ef58356.
4 daysdlmalloc: avoid unnecessary atomics in realloc()Robin Haberkorn1-4/+4
* Atomics are much cheaper than mutexes for such rarely contented fields, but they are still much slower than plain arithmetics. * For realloc(), we'd expect relatively small changes between calls which means that the chunk's usable size probably won't change. Therefore it makes sense to check whether we'd get a zero addition to teco_memory_usage. * We will now have at most one atomic add in realloc() instead of always 2 atomic operations.
4 daysREADME: show badge instead of icon at the bottom of the pageRobin Haberkorn1-1/+1
4 daysgtk-broadway-run.sh: kill broadwayd on SIGINT and SIGTERM as wellRobin Haberkorn1-1/+1
7 daysteco_parse_shell_command_line() is now publicRobin Haberkorn2-25/+27
It can also be useful for spawning $SCITECO_CLIPBOARD_SET/GET processes (currently via popen()) and for launching language servers.
7 daysdisable dlmalloc in Valgrind CI checksRobin Haberkorn1-1/+2
Otherwise, valgrind won't be able to detect malloc()/free() misuse. In other words, CI-driven Valgrind checks have always been broken.
7 dayscurses: fixed theoretical memory corruption when using clipboard registersRobin Haberkorn1-2/+2
But I doubt that get_string() could in practice fail on the plain environment variable Q-Regs. So this was never triggered.
14 dayshide #recovery# files from auto-completions, unless you already typed '#'Robin Haberkorn3-14/+26
* These files are created regularily and shouldn't be mangled with unless you're recovering from a crash. So it makes sense to hide them by default, just like the hidden .teco-* savepoint files. * Recovery file name creation and checks are now centralized in file-utils.h.
14 days`A` without arguments is now equivalent to `0A`Robin Haberkorn2-3/+16
* It was equivalent to `1A` which is almost never what you want. I doubt that any existing macros would be broken by this. But neither do I replace all `0A` in the existing code base (yet). * `A` without arguments is a completely different "append" command in TECO-11, but it doesn't make sense in SciTECO and I don't see what else `A` could be repurposed for. It cannot be made an insertion command since it depends on the stack state which we don't track in parse-only mode. * Added test case.
14 daysconditionals can be terminated with F" now in addition to a single-quote (')Robin Haberkorn5-32/+55
This is useful when writing small macros directly on the command-line as in `sciteco --eval`. If you use double quoted shell strings, too many characters have to be escaped. If you use single-quotes, though, embedding the conditional end (') is annoying -- it would have to be written as '\''.
14 daysimplemented E*q to store the last command lineRobin Haberkorn3-3/+16
`*q` can only be used at the very beginning of the command line. We cannot support it everywhere as Video TECO did since we do not follow the operators in parse-only mode. `E*q` is a replacement, so you can store the previous command line at any later point. This also adds a test case.
2026-07-26minor documentation update (sciteco(1) and sciteco(7)) and comment changesRobin Haberkorn4-18/+17
2026-07-25get rid of teco_qreg_vtable_t::undo_set_integer()Robin Haberkorn6-48/+18
It was never required as a separate callback/method, but was kept merely for consistency. Since we now call teco_current_doc_set_dot() in teco_qreg_dot_set_integer(), we'd have to split it up into an "undo" method as well. I decided to get rid of the superfluous Q-Reg method instead. It's quite likely we could get rid of the remaining undo_set_string(), undo_exchange_string() and undo_edit() callbacks as well (TODO).
2026-07-25revised and improved the Unicode glyph-to-byte conversion heuristicsRobin Haberkorn21-148/+433
Previously almost all glyph-to-byte offset conversions consulted Scintilla's line index and counted characters on the resulting line. For instance a simple expression like `.+1J` would scan the same line twice completely, which would be very slow on pathologically long lines. Even insertions did that due to having to update the ^Y ranges. If you repeat such an operation over all characters as in `<.+1:J;>` you would have complexity O(n^2) for n = line length. Only commands with an explicit relative nature like `C` and `A` would use teco_view_glyph2bytes_relative() which scans beginning at dot as long as the relative movement is less than 1024 glyphs. Wit the new heuristics almost all glyph-to-byte and byte-to-glyph conversions can make use of that optimization. This requires that dot must at all times be known in glyphs as well - the byte position is managed by Scintilla (SCI_GETCURRENTPOS). We therefore introduced teco_current_doc_set_dot() and teco_current_doc_get_dot() to update dot in the current buffer or Q-Register -- it cannot be stored along with the view since Q-Registers share a single view. A number of auxiliary functions have been introduced for converting relative to a known (glyphs,bytes) offset pair and for converting absolute and relative positions with regard to the current doc and SCI_GETCURRENTPOS position. Of course this is error-prone since the glyph and dot positions are interdependant - they must always be kept in sync. With these new optimizations even pathologically long lines can (usually) be managed even in UTF-8 documents. It does not address slow-downs in Scintilla's line layout, yet. grosciteco.tes for instance runs twice as fast now.
2026-07-24fixed lexer initialization if $SCITECOPATH happens to contain glob charactersRobin Haberkorn2-1/+8
* Always use ^ENq instead of ^EQq in the first argument of `EN`. * Added a "Globbing" test case - globbing was undertested anyway.
2026-07-24fixed case-insensitive searches with non-ANSI (Unicode) patternsRobin Haberkorn2-5/+5
* Since case-insensitivity is the default, you couldn't effectively search for non-ANSI characters, although character classes were not affected. * This was a terex bug, i.e. wasn't broken in v2.5.2. * Test cases have been added. The test case for searching for ^E (5) has been simplified using `^E<5>`.
2026-07-23grosciteco.tes: removed obsolete optimizationRobin Haberkorn1-21/+2
Inlining the macro calls no longer results in a 25% speedup.
2026-07-21`make check` doesn't have to build documentation firstRobin Haberkorn1-1/+1
Building documentation is slow, so this speeds up development-test cycles.
2026-07-11XML lexer is activated for _service files and YAML for *.sls (Salt States)Robin Haberkorn2-2/+4
2026-07-05gtk-broadway-run.sh is now used in all headless buildsRobin Haberkorn7-240/+14
* It's already used on home:rhaberkorn:sciteco:UNSTABLE (OBS). We cannot introduce it in STABLE though until the next stable release which will contain the gtk-broadway-run.sh script. * The FreeBSD packaging is actually not tested yet. The package version had been dumped to 2.6.0 since it definitely won't work with v2.5.2 tarballs. The v2.5.2_1 patches have consequently also been removed. You can still find them in the bugzilla ticket (not merged into ports yet).
2026-07-05terex is built with assertions now on --enable-debugRobin Haberkorn3-2/+8
* terex disables assertions by default unless you add `-DREG_DEBUG`. Since we heavily modified the original by Henry Spencer it makes sense to enable assertions. * dlmalloc will still be built without assertions even if --enable-debug is given since that has a significant speed impact and I consider dlmalloc to be rock solid. It would need `-DDEBUG=1` to enable assertions (among other things). We only disable additional checks in dlmalloc if --disable-debug.
2026-07-05added gtk-broadway-run.sh as an alternative to xfvb-runRobin Haberkorn2-0/+31
The latter sometimes fails and causes a lot of fallout on OBS servers. gtk-broadway-run.sh uses the GTK Broadway backend instead and will only work with GTK applications. It is currently tested for the Debian and RPM packages and might later be integrated into the FreeBSD package as well.
2026-07-04FreeBSD: fixed crashes with `EC` or `EQq`Robin Haberkorn1-0/+20
* GSpawn ends up calling posix_spawnp() which passes down a small 4kb stack to the child process until it exec()s. This stack could be overflowed easily on code paths where the path is not already absolute and when many shared libraries are involved. * The crashes could therefore only be observed on Gtk builds and in UNIX shell emulation mode (0,128ED). Sample test case: gsciteco -e '0,128ED @EC"ls"' Theoretically a relative $SHELL variable could have also triggered it. * I assume that the bug will be fixed in libc at least by the time of FreeBSD 16. * As a workaround we resolve relative program paths before passing them to g_spawn_async_with_pipes().
2026-07-03terex, dlmalloc and rb3ptr are now built with `-Wall`Robin Haberkorn3-0/+2
dlmalloc had one bogus unused variable warning, so we also added `-Wno-unused-but-set-variable`. We don't want to change upstream sources unless absolutely necessary.
2026-06-29regular expression matching can now be reliably interrupted using CTRL+CRobin Haberkorn3-22/+7
* The previous checks for interruptions only helped in a few corner cases like for very high search-repeat counts or during backwards searches across the entire buffer. * But even with terex' more predictable runtime properties a single regex execution can hang quite a long time. E.g. `S^EM^X$` on a huge buffer or even more so with backreferences as in `S^~(.*)\1$`. * We now use the new tere_set_is_interrupted_cb() to register teco_interface_is_interrupted(). Types should be compatible as long as gboolean resolves to int. * It's no longer necessary to manually check for teco_interface_is_interrupted() since tere_exec() now returns REG_EINTR in case the callback returned TRUE in which case it's handled by teco_error_regex_set().
2026-06-29fixed searching for `)`Robin Haberkorn1-1/+1
It for some strange reason had to be escaped for AREs even though a single freestanding `)` cannot mean anything.
2026-06-29sciteco(7): added THANKS TO section and link to the ARE syntax descriptionRobin Haberkorn2-2/+23
This for the first time mentions all of the bundled core libraries in the end user documentation.
2026-06-29implemented the ^~ pattern match construct: the rest of the pattern will be ↵Robin Haberkorn3-9/+35
an Advanced Regular Expression * Allows searching by regular expressions. We will never support all ARE constructs in TECO patterns, so this is useful to have available. * Can only be typed upcaret. This leaves ^E~q available as an escape-regexp string building construct. * Once we replace the pattern2regexp converter with a custom terex lexer, we might want to restrict ^~ to the beginning of the pattern. Currently, however it can be anywhere, so you can mix TECO patterns with regular expressions.
2026-06-28fixed block-wise backwards searchesRobin Haberkorn2-2/+3
The calculation of the block start was faulty and could cause underflows resulting in unpredictable behavior.
2026-06-28fixup: fixed searching for `|` - it must also be escaped when converted to a ↵Robin Haberkorn1-1/+1
regular expression
2026-06-28fixed ^EGq (character class) pattern construct for embedded null bytes and `-`Robin Haberkorn2-3/+55
This was using g_regex_escape_string() which always translates a null byte to `\0`, which is ambiguous if followed by other digits, so a null byte followed by a digit would result in a wrong regular expression. Actually the same could happen outside of character classes, ie. `@S/^@1/` was also broken. Also it does not escape `-`, so the result cannot be used in character classes. This is fixed now in a new custom implementation teco_regex_escape(). Once moving to a custom terex lexer, we won't need any of this of course unless we want to provide a regex escaping string building construct. We are now completely free of GRegex.
2026-06-28teco_globber_t is ported from GRegex to terexRobin Haberkorn3-43/+53
It's now a private struct, so we can include the regex_t wihout having to draw in the terex headers everywhere.
2026-06-28terex is the new regular expression engine now and replaces PCRE (GRegex)Robin Haberkorn11-175/+187
* terex is based on Henry Spencer's regular expression engine for Tcl. It is a hybrid NFA/DFA design which has better worst-time runtimes than the backtracking PCRE. Memory usage is also limited and can no longer increase catastrophically. * It should no longer be possible to crash SciTECO with pathological searches. * Since it reliably supports partial matches (REG_EXPECT) we can now enable the new backwards-search algorithm by default. This used to be broken because of a glib bug, which I already fixed. It would however take a long time until this ends up on the majority of glib installations. * Regexp executions can still be quite slow if you are looking for a pattern at the end of a huge file, which can hang the editor, but this can now at least theoretically be solved by adding hooks into terex to poll for interruptions. * We can now also get rid of a TECO-pattern to regexp translation step by directly generating terex tokens (TODO). * Performance-wise terex appears to be slower than PCRE for simple forward searches even when linking everything with optimzations (FIXME). * Having a stand-alone regular expression engine is also a huge step in getting rid of glib. See also: https://git.fmsbw.de/terex/about/
2026-06-14monkey-test: use `I^P` instead of old `EI` (renamed in v2.5.0)Robin Haberkorn1-1/+1
2026-06-07fixup aa7b0bb1445feeefafdcf47fd639b10500b45c03: some minor optimizationsRobin Haberkorn1-21/+21
A partial match __should__ always be at the end of the subject string (i.e. block), so we don't have to check for it. Also, partial matches will be rare, so we can discriminate against the branch that handles them.
2026-05-31updated TODORobin Haberkorn1-5/+34
2026-05-31implemented but disabled block-wise backwards search algorithmRobin Haberkorn4-77/+276
* The block-wise search algorithm allows for efficient backwards searches on large files. * On the downside the results are not entirely symmetric to forward searches. It therefore makes sense to still support the old correct but possibly slow algorithm. Since the old algorithm is just a special case of the new one (with a single block stretching the entire search range), you can configure the block size using `8EJ`. * Unfortunately, the new block-wise algorithm won't work due to a bug in GRegex (only in the glib wrapper code). It is therefore disabled for the time being by default and will probably only be enabled once we switch to a new regexp engine. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/5199
2026-05-20FreeBSD port: added patches for a v2.5.2_1 release that should fix building ↵Robin Haberkorn3-0/+112
on arm64 and riscv * I don't want to release a new upstream version since master isn't stable, yet. I also don't want to branch out a stable v2.5 branch. So we just add the necessary patch files. * Also fixes the `_` register pollution when opening new files. * Should fix Poudriere arm64 builds that are currently causing fallout.
2026-05-20check for sbrk() even on UNIXRobin Haberkorn2-6/+10
* Turns out that not all UNIXes support sbrk(). FreeBSD arm64 and riscv ports don't implement sbrk(). It's also apparently not in POSIX - so other systems might also be affected. This needs to be passed on to dlmalloc. * We now use DLMALLOC_CPPFLAGS instead of conditionals to pass on flags to dlmalloc. * Should be backported to the FreeBSD v2.5.2 package to fix Poudriere fallout.
2026-05-10allow CTRL+C interrupting forward and background searchesRobin Haberkorn1-0/+12
* You can provoke hangs in forward searches when opening large files: `100000S^X$` This cannot be sped up, but must be interruptible. * With backwards searches it is even easier to provoke. Go to the end of a large file and perform any backwards search, even `-S$`. Since we must always search from the beginning of the document, you will always produce all matches over the entire document. There might be ways to speed up backwards searches, but they must be interruptible anyway. * Perhaps we can extend back the search range in chunks of 1-4kb until we produce at least `-count` matches.
2026-05-10fixup: prevent warnings due to missing parameter namesRobin Haberkorn1-1/+1
This would be a C23 extension.
2026-05-10support "default colors"Robin Haberkorn13-89/+160
* The terminal's default foreground and background colors are now used by default (`sciteco --no-profile`), so SciTECO integrates naturally into all terminal color schemes, even dark-on-bright ones. * The default Scintilla colors use only 0x000000 (COLOR_BLACK) and 0xC0C0C0 (COLOR_WHITE) now. * You can use `7EJ` to configure the default colors in color schemes or your profile. All existing color schemes had to disable default colors (`-1,-1,7EJ`) since they wouldn't look well otherwise. * You may add `-1,7EJ` to ~/.teco_ini when using a terminal emulator with a washed-out palettized COLOR_BLACK. We cannot detect the terminal's default colors automatically. * Scinterm updated to v6.0. We require a not-yet-upstreamed patch: https://github.com/orbitalquark/scinterm/pull/40 * In fact, we might decide not to support default colors at all in Scinterm, so this feature should be considered experimental.
2026-05-09updated Scintilla to v5.6.2Robin Haberkorn1-0/+0
* This is mainly to support Scinterm 6.0, which does not appear to work with older Scintilla versions (obviously a bug). * SCI_SETTABDRAWMODE(SCTD_CONTROLCHAR) has been merged upstream * SC_LINE_END_TYPE_NONE will not be merged and may have to be permanently maintained.
2026-04-27opener.check-recovery: don't pollute Q-register `_`Robin Haberkorn1-2/+2
This has been broken since v2.5.2.