aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
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
2025-04-27opener.tes: Fixed +line,column syntaxRobin Haberkorn3-9/+23
* After detecting +line[,column] constructs, the next argument is not parsed as a potential filename:line[:column] construct. * This code turned out to be tricky to get right, so I added a test case. Standard library modules can well be checked in the test suite since we have $SCITECOPATH pointing to the source tree's lib/ directory. * Make sure that relevant variables from atlocal.in are really exported into the process environment. This was also broken for the Glib debug options.
2025-04-27support folding via F1 and clicks in the folding marginRobin Haberkorn5-0/+36
* Set up the folding margin in the currently empty margin column after the line number. On Gtk, this meant resetting all the marker symbols and their foreground/background colors as well as the margin's colors themselves. This looks like a bug. It's not necessary on Scinterm, which apparently uses the default/linenumber styles by default. Perhaps we should try upgrading Scintilla? * The folding state is considered not to be directly controlled by the language (just like the scroll position and zoom level). That's why we can directly control it by clicking on the margin column. * F1 can be used to toggle all folds globally. * The only support within the C core necessary for folding is to make sure that the current line is unfolded after every keypress. * We might add custom folding commands to the language later on (e.g. F+, F-). In this case, the key macros will have to be changed of course.
2025-04-25README: the Alpine package is now in the "community" repositoryRobin Haberkorn2-6/+2
Also updated NEWS: mention v2.4.0 release.
2025-04-23fixup: fixed monospace sections in womanpages when lexer.font is not ↵Robin Haberkorn3-5/+12
customized (refs #34) * In the grosciteco-generated .woman.tec files, the fonts were only set on the monospaced styles if lexer.font was set since it was undefined by default. We'd need a lare IF-ELSE statement to handle that in womanpages since woman.tes changes the default font to a variable-width font. Just leaving the default font, therefore won't work. * We now always initialize lexer.font in lexer.tes. You no longer have to check for its existance. * Consequently, you can no longer set lexer.font *before* munging lexer.tes because it will be overwritten. At least not without additional checks. Such a design is not suggested by fallback.teco_ini, though. * Fixes monospaced sections in the tutorial and other womanpages on Gtk.
2025-04-22Gtk: monospaced sections in womanpages now respect lexer.font and ↵Robin Haberkorn3-3/+10
variable-width font is configurable via lexer.woman.font (refs #34) * grosciteco was just hardcoding "Monospace", regardless of what was configured via lexer.font in ~/.teco_ini * The variable-width font used for ordinary "womanpage" body texts was hardcoded to "Serif". It is now configurable via the lexer.woman.font register. * There is a difference, though: lexer.font has no default value and must therefore be checked everywhere. This is so you can set it even before munging lexer.tes. lexer.woman.font however has a default (Serif), so it can only be overridden after munging lexer.tes. Perhaps it would be easier and more consistent to have a default for lexer.font as well.
2025-04-19debian: updated changelogRobin Haberkorn1-1/+1
This was supposed to be done before the release, but the braindead `dch` tool did not update the timestamp without changing the changelog entry itself.
2025-04-20FreeBSD: updated package for v2.4.0 releaseRobin Haberkorn3-7/+8
Also use binary packages when testing with Poudriere (gmake -f ./distribute.mk poudriere).
2025-04-19updated ChangeLog and TODO for v2.4.0 releasev2.4.0Robin Haberkorn3-40/+209
* ChangeLogs now contain the dates of all releases. * The FreeBSD package must practically be updated after uploading the release tarball.
2025-04-19Gtk: fixed setting the mouse cursor after changing the active bufferRobin Haberkorn2-2/+12
* The GdkWindow stacking order obviously got messed up when swapping out the child widget in the GtkEventBox. * This was probably also responsible for input events coming through to the Scintilla view even though the GtkEventBox should block all input events from reaching the Scintilla view. The event masking in teco_view_new() is probably no longer necessary - but better keep it to be on the safe side.
2025-04-18scite2co: look up file patterns from filter.<lang> properties instead of ↵Robin Haberkorn1-1/+1
file.patterns The former is more basic and usually references file.patterns. This helped for instance with processing SciTE's css.properties.
2025-04-18added CSS lexer configurationRobin Haberkorn3-1/+77
Especially useful since Gtk users are supposed to edit ~/.teco_css.
2025-04-18Gtk/win32: fixed fonts and therefore pango warnings on startup (closes #7)Robin Haberkorn4-8/+14
* The default womanpage font is the abstract "Serif" now, so that should be more portable. "Times" wasn't found on Windows. * Win32 distributions include a custom .teco_css now, which removes the small-caps font attribute from the type label. The default Gtk theme on Windows references the "Segoe UI" font and it doesn't have a small-caps variant. In fact no default Windows font appears to have one. * We could add a custom .teco_ini to win32 distributions as well, but there is currently no need for it. * Do not distribute the /win32 files. They are used only for building Win32/64 packages. There is no point in distributing them in the tarball if the /debian and /freebsd directories aren't distributed as well.
2025-04-18Gtk: prevent drag-and-drop interaction and block more possibly dangerous ↵Robin Haberkorn1-1/+12
touch and scroll events * You could drag and drop text into the Scintilla views, which would confuse SciTECO. * In the future, we might actually want to support programmable drag-and-drop support via special key macros.
2025-04-17nightlies: install fuse for running AppImagesRobin Haberkorn1-0/+1
2025-04-16CI/Nightly builds: Ubuntu 20.04 runners have been disabledRobin Haberkorn4-9/+9
* We can therefore no longer provide 20.04 nightly builds. Perhaps I will manually build binary releases for the v2.4.0 release for the last time. The PPA will still provide 20.04 of course. * The AppImages are consequently also built based on the Ubuntu 22.04 packages, which are now the oldest supported ones.
2025-04-16curses: minor cleanup - avoid preprocessor statementsRobin Haberkorn1-11/+6
2025-04-15try hard to preserve the vertical scrolling position when auto-scrolling dotRobin Haberkorn2-5/+23
* There are cases, especially where the entire buffer is piped through some external process or when removing and reinserting large parts of the buffer, that dot changes very little, but the vertical scrolling position gets resets. This is especially noticable with the macro @^U{[: HECcat$ ]:}, but also with M#cf (clang-format wrapper from "Useful macros"). * We now try to preserve the vertical position ("first visible line") before scrolling caret.
2025-04-14sciteco(1): added EXAMPLES sectionRobin Haberkorn1-0/+49
2025-04-13Gtk: do not attempt automatic ANSI key translation for dead keysRobin Haberkorn1-0/+5
* At least on Windows it was observed that teco_interface_get_ansi_key() would find ANSI keys on other layouts, but nothing corresponding to the key itself. For instance, for a dead caret (^), we'd find backslash. This made it impossible to type caret in the parser start states. * We clumsily detect whether a keyevent refers to a dead key by checking its symbolic name and pass it down to the input method unmodified. * Fixes entering dead keys, at the very least on Windows, but potentially on all other systems as well.
2025-04-13fixed error message for nW and nP if it would move the pointer beyond the ↵Robin Haberkorn1-2/+2
document's boundaries
2025-04-13Curses: the mouse now scrolls two lines per event in the popup windowRobin Haberkorn1-2/+2
This is hardcoded, but in line with the current defaults from fnkeys.tes.
2025-04-13PDCurses/Win: more or less fixed mouse supportRobin Haberkorn1-6/+37
* Both the WinGUI and Wincon variants have their own idiosyncrasies: * WinGUI ignores `mouseinterval(0)` and may report BUTTONX_CLICKED for very quick clicks. Therefore we now emulate separate PRESSED/RELEASED events. * Wincon does not report BUTTONX_RELEASED at all. Therefore we still enable click detection, so that fnkeys.tes will work at least partially. Therefore we also enable REPORT_MOUSE_POSITION, so that right-click-dragging will work. This should still be fixed in PDCurses upstream, though. * See also https://github.com/Bill-Gray/PDCursesMod/issues/330
2025-04-13fixed undoing bitfields on WindowsRobin Haberkorn16-182/+184
* It turns out that `bool` (_Bool) in bitfields may cause padding to the next 32-bit word. This was only observed on MinGW. I am not entirely sure why, although the C standard does not guarantee much with regard to bitfield memory layout and there are 64-bit available due to passing anyway. Actually, they could also be layed out in a different order. * I am now consistently using guint instead of `bool` in bitfields to prevent any potential surprises. * The way that guint was aliased with bitfield structs for undoing teco_machine_main_t and teco_machine_qregspec_t flags was therefore insecure. It was not guaranteed that the __flags field really "captures" all of the bit field. Even with `guint v : 1` fields, this was not guaranteed. We would have required a static assertion for robustness. Alternatively, we could have declared a `gsize __flags` variable as well. This __should__ be safe since gsize should always be pointer sized and correspond to the platform's alignment. However, it's also not 100% guaranteed. Using classic ANSI C enums with bit operations to encode multiple fields and flags into a single integer also doesn't look very attractive. * Instead, we now define scalar types with their own teco_undo_push() shortcuts for the bitfield structs. This is in one way simpler and much more robust, but on the other hand complicates access to the flag variables. * It's a good question whether a `struct __attribute__((packed))` bitfield with guint fields would be a reliable replacement for flag enums, that are communicated with the "outside" (TECO) world. I am not going to risk it until GCC gives any guarantees, though. For the time being, bitfields are only used internally where the concrete memory layout (bit positions) is not crucial. * This fixes the test suite and therefore probably CI and nightly builds on Windows. * Test case: Rub out `@I//` or `@Xq` until before the `@`. The parser doesn't know that `@` is still set and allows all sorts of commands where `@` should be forbidden. * It's unknown how long this has been broken on Windows - quite possibly since v2.0.
2025-04-12freebsd port: synced with upstream port sourcesRobin Haberkorn1-1/+1
2025-04-10testsuite: check whether comparisons for equality really work with the ↵Robin Haberkorn2-12/+27
`a-b"=` idiom * There might theoretically be problems with the uncommon one's complement or magnitude representation of negative integers, but it's practically impossible to meet those in the wild. * Still, we do some checks now, so we will at least notice any exotic architectures. * Also, documented the `a^#b"=` idiom for checking for equality. It's longer to type, but faster and will also work for floats. For floats it will be the only permissible idiom for checking for bitwise equality as `a-b` can be 0 even if a!=b (if the difference is very small). Changing the `-` semantics is out of the question.
2025-04-10fixed formatting of the smallest possible integerRobin Haberkorn4-2/+19
* In other words, fixed `-9223372036854775808\` on --with-teco-integer=64 (which is the default). * The reason is that ABS(G_MININT64) == G_MININT64 since -G_MININT64 == G_MININT64. It is therefore important not to call ABS() on arbitrary teco_int_t's.
2025-04-09fnkeys.tes: mouse scrolling scrolls 2 lines by default and left clicks ↵Robin Haberkorn1-3/+6
update the horizontal position (4EJ)
2025-04-09added SQL lexer configurationRobin Haberkorn3-1/+73
* Unfortunately, the Lexilla lexer does not recognize PostgreSQL multiline strings between $$...$$. * All of the other SQL variants, that Scite supports, are skipped for the time being. They'd probably have to be separate SciTECO lexer configs anyway.
2025-04-09fixup: <EI> command can be at-modified as in `@EI/foo/`Robin Haberkorn1-1/+2