aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2025-07-20FreeBSD port: also enable malloc-replacement by defaultRobin Haberkorn1-2/+2
2025-07-20FreeBSD: enable dlmalloc by default (--enable-malloc-replacement)Robin Haberkorn2-8/+10
* After re-benchmarking the performance, I in fact detected a 20-25% speedup if memory limiting is active. Both using `time` and the builtin monotic timer ::^B. When memory limiting is disabled, there is no detectable difference to jemalloc. The following test case was used: sciteco -e '::^BUs 100000<@^U[^E\a]"^E\a" %a> ::^B-Qs=' * I also played around with getrusage(), but it doesn't seem to be a viable API for detecting the currently used RSS, i.e. it does not allow recovering from OOMs.
2025-07-20document bug: you cannot currently use `{` and `}` to insert anything after ↵Robin Haberkorn3-1/+14
$$ into the commandline
2025-07-19special Q-registers `$` (working directory) and the clipboard registers now ↵Robin Haberkorn3-25/+21
support the append operation (:Xq, :^Uq...) Works via a default implementation in the "external" Q-register "class" by first querying the string, appending and re-setting it.
2025-07-19fixed <EF> and <EW> with invalid buffer ids (was crashing)Robin Haberkorn3-2/+23
* regression introduced in 2baa14add6d9976c29b27cf4470bb458a0198694
2025-07-19<EW> now accepts a numeric argument to specify the buffer to saveRobin Haberkorn4-38/+59
* In this case we always save the given buffer and never the current Q-Register. * The current Q-Register is only saved without any numeric argument. The same semantics make sense for <EF> so that Q*EF closes the current buffer even when editing a Q-Register. * This variant is present in Video TECO.
2025-07-18revised command topicsRobin Haberkorn8-41/+41
* Added some keywords. * Consistently added command variants with all modifiers. In principle including modifiers in the topics is unnecessary - you can always strip the modifiers and look up the raw command. However, looking up a command with modifiers can speed up the process (compare looking up ?S<TAB> vs ?::S<TAB> * The `@` modifier is listed only for commands without string arguments.
2025-07-18<nEL> (set EOL mode) now sets the buffer's dirty flagRobin Haberkorn2-4/+7
* While it doesn't directly change the buffer's contents in bytes, a subsequent write would result in a different file on disk, so it is consequent to remind the user of saving or discarding changes. * Will also fix :EX after changing the EOL mode.
2025-07-18support <:]q> (pop Q-Register) for getting a success/failure booleanRobin Haberkorn3-4/+17
* Could be used to check whether the stack is currently empty, although peeking would be cumbersome: `:]q"S [q !...! | !...! '` * This is from DEC TECO-11.
2025-07-18make some array declarations real constantsRobin Haberkorn4-5/+5
* `static const char *p = "FOO"` is not a true constant since the variable p can still be changed. It has to be declared as `static const char *const p = "FOO"`, so that the pointer itself is constant. * In case of string constants, it's easier however to use `static const char p[] = "FOO"`.
2025-07-18fixed minor memory leaks of per-state data in teco_machine_main_tRobin Haberkorn7-27/+33
* These were leaked e.g. in case of end-of-macro errors, but also in case of syntax highlighting (teco_lexer_style()). I considered to solve this by overwriting more of the end_of_macro_cb, but it didn't turn out to be trivial always. * Considering that the union in teco_machine_main_t saved only 3 machine words of memory, I decided to sacrifice those for more robust memory management. * teco_machine_qregspec_t cannot be directly embedded into teco_machine_main_t due to recursive dependencies with teco_machine_stringbuilding_t. It could now and should perhaps be allocated only once in teco_machine_main_init(), but it would require more refactoring.
2025-07-16the primary clipboard is now chosen by the 10th bit in the ED flagsRobin Haberkorn7-70/+47
* `[q]~` was broken and resulted in crashes since it reset the clipboard character to 0. In fact, if we don't want to break the `[a]b` idiom we cannot use the numeric cell of register `~`. * Therefore we no longer use the numeric part of register `~`. Once the clipboard registers are initialized they completely replace any existing register with the same name that may have been set in the profile. So we still don't leak any memory. (But perhaps it would now be better to fail with an error if one of the clipboard registers already exist?) * Instead, bit 10 (1024) of ED is now used to change the default clipboard to the primary selection. The alternative might have been an EJ flag or even a special register containing the name of the default clipboard register. * partially reverses 8c6de6cc718debf44f6056a4c34c4fbb13bc5020
2025-07-14Windows nightlies: install zip, hopefully fixing the nightly buildsRobin Haberkorn1-2/+2
2025-07-13Windows nightly builds are built on Windows Server 2022 nowRobin Haberkorn1-2/+2
Server 2019 has been deprecated.
2025-07-13implemented <ER> command for reading a file into the current bufferRobin Haberkorn8-30/+96
* This command exists in Video TECO. In Video TECO it also supports reading multiple files with a glob pattern -- we do not support that as I am not convinced of its usefulness. * teco_view_load() has been extended, so it can read into dot without discarding the existing document.
2025-07-13allow changing the default clipboard by setting the `~` integerRobin Haberkorn7-36/+122
* It continues to default to 67 (C), which is the system clipboard. But you can now overwrite it e.g. by adding `^^PU~` to the profile. * This fixes a minor memory leak: If you set one of the clipboard registers in the profile (initializing them as plain registers), the clipboard register had been leaked. The clipboard registers now replace any existing register, while at the same time preserving the numeric part. * All remaining Q-Reg table insertions use a new function teco_qreg_table_insert_unique() which adds an assertion, so that we notice any future possible memory leaks.
2025-07-13minor documentation fix in parser.cRobin Haberkorn1-1/+1
2025-07-11<EF> supports a numeric buffer id nowRobin Haberkorn6-49/+88
* ED hooks are not executed in this case * <EF> is now allowed even when editing a Q-Reg, unless you try to close the current buffer
2025-07-04implemented <^B> for returning the current dateRobin Haberkorn3-1/+47
* It is encoded with the same formula as on VAX/VMS on TECO-11, on TECOC and TECO-64. * As an extension, when colon-modified it returns the number of seconds since the epoch. It might be even more useful to return the microseconds since the epoch, but that would require 64-bit integers, which can theoretically be disabled at build time.
2025-07-03implemented ^E<code> string building constructs for embedding bytes and ↵Robin Haberkorn5-41/+128
codepoints in a strtoul()-like manner
2025-07-01GTK: handle (smooth) scrolling with a scroll controllerRobin Haberkorn1-15/+42
* On interfaces, which only support smooth scrolling, we had to emulate discrete events. Moreover, once we enabled GDK_SMOOTH_SCROLL_MASK, systems that would previously report discrete UP/DOWN events, would suddenly report GDK_SCROLL_SMOOTH. * Converting from smooth scroll events to discrete scroll events turned out to be trickier than anticipated. Scrolling was therefore more sluggish than it used to be before 2f448c976889fe60aba8557b5aa4aa0a0d939281. * Scrolling is therefore now delegated to a GtkEventControllerScroll, which is used to synthesize a discrete GDK_SCROLL event that's fed into the usual event pipeline via teco_interface_input_cb().
2025-06-27fixed ^S/^Y for <Gq> and <EN>Robin Haberkorn3-8/+12
* We must call teco_interface_bytes2glyphs() only ever with byte offsets that already exist in the buffer. * regression, introduced in aaa1d51a4c85fcc627e88ef7cf5292d9c5f5f840
2025-06-27fixed an asterisk in the <EN> manpage entryRobin Haberkorn2-1/+2
* We have to avoid `/*` within comments, so one of the two characters will have to use a named glyph. \[**] is actually a special symbol, which wasn't noticed until supporting Unicode. There is no named glyph for the plain asterisk. Thus we now use \[sl] to escape the `/` character. `/\c*` might have also worked. * grosciteco now supports the `sl` glyph.
2025-06-15PDCurses/Wincon: disable hardware cursor after window resizeRobin Haberkorn1-0/+5
2025-06-15require and adapted to PDCurses v4.5.1Robin Haberkorn3-12/+13
* PDCurses is practically used only for Windows builds, which only I build presumably, so it should be okay to bump the version. * Older PDCurses versions had serious problems like not detecting BUTTONX_RELEASED events. This was worked around and is fixed now. Even the Wincon version behaves like ncurses now with regard to mouse events. * We no longer have to support processing BUTTONX_CLICKED events. On the downside the mouse mask had to be adapted. * See also https://github.com/Bill-Gray/PDCursesMod/issues/330 * We also no longer have to call resize_term(0,0).
2025-06-15Revert "PDCurses/Win: more or less fixed mouse support"Robin Haberkorn1-37/+6
This reverts commit 8cc704b897f33d6150156c77202a29222b9ee667. This is no longer necessary with PDCurses v4.5.1. Keeping compatibility with old PDCurses versions is not very important as only I currently build and provide Windows binaries. Also, the previous workaround decreases usability on PDcurses/wincon even with a newer PDCurses library.
2025-06-12GTK: fixed scrolling on systems that only support smooth scrollingRobin Haberkorn1-4/+12
* Apparently, we cannot disable smooth scrolling on a per-application basis, so I have to handle both discrete and smooth scrolling events. * Since SciTECO's scroll API (-EJ) is based on discrete scrolling, we now emulate discrete scroll events by accumulating the delta_y of smooth scroll events. The threshold value of 12 is chosen arbitrarily, but based on an example in the Gtk documentation.
2025-06-08^S/^Y calculates the glyph offsets earlierRobin Haberkorn8-31/+65
* Previously, deleting text after a text match or insertion could result in wrong ^S/^Y results. In particular, the amount of characters deleted by <FD> at the end of a buffer couldn't be queried. * This also fixes the M#rf (reflow paragraph) macro.
2025-06-07updated README and TODORobin Haberkorn2-20/+32
2025-06-07initialize some variables in teco_state_expectqreg_input() to silence the ↵Robin Haberkorn1-2/+2
Clang static analyzer There was the possibility that an unitialized value is passed into a got_register_cb(). This could only happen in normal parse mode and it's unlikely to have caused problems in practice as all callbacks should not rely on qreg being valid in parse-only mode. This sort of bug would have also been catched by Valgrind. The rest of the scan-build-reported warnings are bogus (caused by not being g_auto-aware).
2025-06-07added <FN> as a search-and-replace variant of <N>Robin Haberkorn4-3/+60
* This is not in Video TECO, but TECO-11 has a search-and-replace variant of <N>. <N> however is a search-over-page-boundary command in TECO-11, which has been repurposed as search-over-buffer-boundary in Video TECO and SciTECO. * <N> and <FN> no longer call the edit hook after *every* invocation, but only if the current buffer changes. This is not really relevant with the current default hook from fallback.teco_ini, but might be depending on the use case. * Added testcases both for <N> and <FN>.
2025-06-04CI: test only on win64 as mingw-w64-i686-pdcurses was apparently dropped ↵Robin Haberkorn1-7/+7
from MSYS Ther rest of mingw32 still appears to exist, though.
2025-06-03added LaTeX lexer configRobin Haberkorn3-1/+35
2025-06-01<nA> and <nQq> now return -1 in case the index n is out of rangeRobin Haberkorn5-33/+27
* The old behavior of throwing an error was inherited from Video TECO. * The command is now more similar to TECO-11. * Since -1 is taken, invalid and incomplete UTF-8 byte sequences are now reported as -2/-3. I wasn't really able to provoke -3, though.
2025-05-24<EI> has been repurposed and is the macro file inclusion (indirect file) ↵Robin Haberkorn12-36/+29
command now * Improves DEC TECO-11 compatibility. * <EM> is still supported as a synonym, but considered deprecated and is no longer documented. A warning is printed when invoked. It can be repurposed at any time in the future. * `EI$` is not yet supported. I am unsure whether this makes any sense.
2025-05-24new string building construct ^P disables all further string building magicRobin Haberkorn3-23/+31
* Now, `I^P` can replace `EI`. EI is therefore now free to be repurposed as the new "mung file" command for improved TECO-11 compatibility. * On the downside when inserting large blocks of TECO code, you will have to write something like `@I{^P !...! }` * The construct is also useful when searching for carets as in `S^P^Q^`.
2025-05-23<^C> is a plain "return" command now, while <^C^C> exits from the programRobin Haberkorn3-101/+193
* This may break existing macros! ^C is now essentially a synonym for $$ and may not terminate the program when called from a non-toplevel macro frame. However it improves compatibility with TECO-11. * In contrast to TECO-11, ^C^C (exit) can be typed completely in upcaret mode. Otherwise it wouldn't have been possible to use the exit command in ASCII-only scripts. * The implementation of ^C^C uses a lookahead state similar to ^[ (escape). ^C does not return immediately, but the following character determines whether it will perform a return or exit. It's one of the rare cases in SciTECO where this is possible and safe since ^C is also disallowed on the command-line to avoid undesired command-line terminations after ^C interruptions. (You can only use $$ to terminate the command-line interactively.)
2025-05-20debian package: removed copyright of mingw-bundledllsRobin Haberkorn1-25/+0
It is no longer in the tarballs, so there is no need to document the license.
2025-05-18allow process exit status to be determined by macrosRobin Haberkorn4-14/+38
* Any value left on the numeric stack now determines the exit code. This ensures you can call n^C as the SciTECO version of exit(n). It will also work with n$$ in the top level macro. But you don't necessarily need any of these commands. * Could be useful in shell scripting as in `sciteco -e "@EB/file/ :@S/foo/\"F1'"` to fail `foo` is not found.
2025-05-18sciteco(7): added a help topic for booleansRobin Haberkorn1-0/+1
So you can lookup `?bool$` for instance.
2025-05-16python lexer: fixed block comment stylingRobin Haberkorn1-1/+3
Also, unterminated strings are highlighted with the "error" color now.
2025-05-13revised test suite: got rid of most escaping for the TECO code snippetsRobin Haberkorn2-172/+179
* Test cases where hard to read since there was a layer of shell and M4 escaping -- sometimes with the help of quadrigraphs -- to preserve the original TECO characters. * We introduced TE_CHECK() and TE_CHECK_CMDLINE() M4 macros which care about shell escaping automatically. * If all TECO code is double quoted with [[ and ]], single square and round brackets are preserved as well. * Only in case of using *unbalanced* single square brackets, you have to take action and add `![!` or `!]!` TECO comments to balance them out. This is still better than quadrigraphs. * The $ESCAPE and $RUBOUT environment variables are replaced by equivalent M4 macros, so they can be used with TE_CHECK_CMDLINE(). * Other references to shell variables have been resolved by exporting them into the environment (as in the case of $srcdir) or by introducing new M4 macros (TE_MAXINTxx, TE_MININTxx). * The $WORDS_EXAMPLE variable has been got rid of by writing it into a temporary file instead. There is some redundancy -- in principle an M4 macro could have also been used. * This leaves only 6 remaining usages of AT_CHECK() for invoking SciTECO, mainly for testing opener.tes, where we have to pass in command line arguments. In theory most of them could be avoided as well by preparing the unnamed buffer appropriately. However the way that command line parameters are passed will be changed sooner or later. * This uses GNU M4 extensions, but Autoconf requires that anyway.
2025-05-03updated TODORobin Haberkorn1-1/+43
2025-05-03disallow command-line termination ($$) while editing the command-line ↵Robin Haberkorn2-0/+17
replacement register (after `{`) I found that terminating the command-line while editing the replacement register, leaves you in a hard-to-recover state. You can/should no longer call `}`, so you would have to go back to the last buffer (Q*U*). Instead, this is now checked against and a test case has also been added.
2025-05-03fixed teco_doc_undo_exchange(): use reference counting nowRobin Haberkorn2-2/+19
* When popping from the Q-Register stack to local Q-Registers in macro calls, problems would arise when rubbing out that macro call since we would eventually restore a pointer that has been permanently freed along with the local Q-Registers. * Naturally this could result in everything from Valgrind warnings to crashes. * Added test case. * There is still a test case that fails when run under `--valgrind`, but it's apparently due to a glib-internal memory leak.
2025-05-02implemented folding for the SciTECO lexerRobin Haberkorn1-1/+26
* This currently folds only {...} string arguments and embedded braces, most prominently `@^Um{...}` macro definitions.. * Any additional folding for loops and IF-statements should rely on book keeping by the main parser. This would also help catch syntactic errors, like dangling IFs. * We do keep track of the loop nesting, but currently only in execution mode. * It cannot be disabled via the "fold" property. Lexers in the container do not have properties.
2025-05-02auto-expand folds even after mouse eventsRobin Haberkorn3-6/+12
The ^KMOUSE macro can also change dot and it was possible to place dot into invisible areas at the end of the document.
2025-05-02grosciteco: folding in woman pagesRobin Haberkorn4-0/+64
* Support fold level configuration using `.SCITECO_FOLDLEVEL`. This sets the current output line as the fold header and all subsequent lines with the given fold level (until another `.SCITECO_FOLDLEVEL` instruction is encountered). * This is now done automatically for man's SH and SS macros, so the man-page based woman pages provide folding. * The folding margin is therefore now always enabled in fallback.teco_ini.
2025-05-01implemented email and git lexer foldingRobin Haberkorn2-5/+23
2025-05-01folding: enable markers for sub-folds as wellRobin Haberkorn1-3/+4