aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2025-04-06session.tes extensions: allow per-session .teco_ini; detect sessions in ↵session-extensionsRobin Haberkorn2-12/+4
arbitrary parent directories (WIP) * Unfortunately not that easy to get right, especially the per-session .teco_ini. * We must make sure that we do mung the $SCITECOCONFIG/.teco_ini. * .teco_ini must always be munged even if .teco_session is not munged.
2025-04-04avoid legacy implict rules in doc/Makefile.am: should fix clean buildsRobin Haberkorn1-3/+2
For some strange reason, Make wouldn't know how to get tutorial.ms. Replacing it with an equivalent `%` works flawlessly, though.
2025-04-04scroll caret __almost__ always automatically after key pressesRobin Haberkorn4-9/+16
* The old heuristics - scroll if dot changes after key press - turned out to be too simplistic. They broke the clang-format macro (M#cf), which left the view at the top of the document since the entire document is temporarily erased. Other simplified examples of this bug would be: @^Um{[: HECcat$ ]:} Mm Or even: @^Um{[: H@X.aG.a ]:} Mm * Actually, the heuristics could be tricked even without deleting any significant amount of text from the buffer. The following test case replaces the previous character with a linefeed in a single key press: @^Um{-DI^J$} Mm If executed on the last visible line, dot wouldn't be scrolled into the view since it did not change. * At the same time, we'd like to keep the existing mouse scroll behavior from fnkeys.tes, which is allowed to scroll dot outside of the visible area. Therefore, dot is scrolled into view always, except after mouse events. You may have to call SCI_SCROLLCARET manually in the ^KMOUSE macro, which is arguably not always straight forward. * Some macros like M#cf may still leave the vertical scrolling position in unexpected positions. This could either be fixed by eradicating all remaining automatic scrolling from Scintilla or by explicitly restoring the vertical position from the macro (FIXME). * This was broken since the introduction of mouse support, so it wasn't in v2.3.0.
2025-04-03the tutorial is now built along with all other HTML documents if ↵Robin Haberkorn7-22/+34
--enable-html-docs * `--enable-html-manual` renamed to `--enable-html-docs`. * It's also uploaded to the website and linked to in README.
2025-04-03tutorial: fixed excess space after example display blocks in some versions ↵Robin Haberkorn1-0/+6
of Groff
2025-04-03improved the "asm" (x86 assembly) lexerRobin Haberkorn1-1/+9
There are still some glitches with non-mainstream assemblers like A86, though.
2025-04-01updated Scinterm to v5.4: Only show scroll bars when they can be scrolledRobin Haberkorn1-0/+0
2025-03-31FreeBSD port: ship email lexer and tutorialRobin Haberkorn1-2/+5
The email, git and sciteco lexer configurations are bundled even without the LEXILLA option.
2025-03-31the git, sciteco and email lexer configurations are now installed even ↵Robin Haberkorn1-5/+5
--without-lexilla They don't require Lexilla, so it makes no sense not to exclude them.
2025-03-31fixup: `make clean` removes tutorial.ms nowRobin Haberkorn1-6/+5
Fixes `make distcheck` and CI builds.
2025-03-31grosciteco: added the `oq` and `cq` glyphsRobin Haberkorn1-0/+2
This fixes building of the new tutorial.woman on Ubuntu.
2025-03-31fixup: actually distribute the new tutorial.ms.in fileRobin Haberkorn1-14/+7
2025-03-31fixup: fixed Ubuntu nightly buildsRobin Haberkorn1-1/+1
groff is now required in its entirety
2025-03-31added tutorial document, which is automatically loaded on the first invocationRobin Haberkorn5-1/+329
* This is rendered with ms, so we now need the entire groff on Debian. This is not a big deal as it just adds a few kilobytes of build-time dependencies. Most platforms do not allow installation of some "groff-base" package anyway and always draw in the entire package. * sciteco.tmac has been extended to disable page breaks on ms. * The tutorial is installed like any other woman page and can be invoked interactively with ?tutorial$. * It is optimized to be still usable on a plain 80x24 terminal.
2025-03-31opener.tes: fixed opening filename:line if filename has trailing digitsRobin Haberkorn1-3/+4
The trailing digits where cut off the filename. E.g. when trying `sciteco test.f77:100`, we would open test.f on line 100 instead.
2025-03-29added v2.4.0 screenshot: VT240 emulationRobin Haberkorn1-0/+4
* An Aerc screenshot would also be nice, but I don't have a neutral account set up.
2025-03-29bumped target release to v2.4.0 and updated README and TODORobin Haberkorn4-32/+96
* Added a test case for the known bug of out-of-place modifiers. Well, this is a syntactic shortcoming rather than a true bug. But I did run into it more than once.
2025-03-29^W also rubs out/in `@` and `:` modifiersRobin Haberkorn2-0/+18
* It makes little sense to e.g. rub out until `I` in `@I/foo/`, but leave the `@` modifier. Modifiers have to be considered part of the command, even though the state machine is not currently modelled like that.
2025-03-29added `@W`, `@P`, `@V` and `@Y` command variantsRobin Haberkorn5-140/+144
* They swap the default order of skipping characters. For positive arguments: first non-word chars, then word chars. * This is especially useful after executing the non-at-modified versions. For instance, at the beginning of a word, `@W` jumps to its end. `@V` would delete the remainder of the word. * Since they have to evaluate the at-modifier, which has syntactic significance, the command implementations can no longer use transition tables, so they are in the switch-statements instead.
2025-03-23grosciteco: fixed topic collectionRobin Haberkorn1-1/+1
* regression from 867d22e419afe769f05ad26b61c6ea5ea1432c3c
2025-03-23the ES command (send Scintilla message) now supports passing both wParam and ↵Robin Haberkorn6-18/+44
lParam as null-terminated strings * Being able to embed null bytes into the lParam string is practically useless - there aren't any messages where this is useful and where there are no native SciTECO counterparts - so this case is now catched and the null-byte separates wParam from lParam. * wParam can be the empty string, but it is not supported to pass wParam as a string and lParam as the empty string. If the second string argument ends in ^@, lParam is popped from the stack instead. * This is a temporary workaround until we can properly parse the Scintilla.iface and generate more elegant per-message wrappers. * It in particular unlocks the SCI_SETREPRESENTATION and SCI_SETPROPERTY messages. The former allows us to write a special hex-editor macro which sets hexadecimal character representations, while the latter allows you to set lexer properties. * The C-based lexers ("cpp" in Lexilla) can now take preprocessor definitions into account. This is disabled by default, unless you set lexer.c.defines before opening a file. You can also set it interactively and re-set the lexer. For instance: ^U[lexer.c.defines]NDEBUG$ M[lexer.set.c]
2025-03-23refactored Lexilla/Scintillua support: it's now in teco_create_lexer()Robin Haberkorn1-59/+80
2025-03-23sciteco(7): fixed formatting of some tablesRobin Haberkorn1-4/+4
This was changed ages ago for some old version of Groff. These workarounds should no longer be necessary.
2025-03-23the ^W immediate editing command now mimics `Y` more closely and also rubs ↵Robin Haberkorn4-11/+31
out no-op commands (whitespace) * In string arguments, ^W first rubs out non-word chars (usually whitespace), so it makes sense if ^W would work analogously at the command level. A non-command would be one of the no-ops.
2025-03-22build nightlies on Ubuntu 24.04 as wellRobin Haberkorn2-2/+2
* Also run CI on 24.04. * The Ubuntu 20.04 runner is deprecated soon until 1. April 2025, but for the time being we keep supporting it as well.
2025-03-22added `P` command as a reverse form of `W`Robin Haberkorn5-9/+49
* All the movement commands have shortcuts for their negative forms: `R` instead of `-C`, `B` instead of `-L`. Therefore there was always the need for a `-W` shortcut as well. * `P` is a good choice because it is a file IO command in TECO-11, that does not make sense supporting. In Video TECO it toggles between display windows (ie. split screens) and I do not plan to support multiple windows in SciTECO. * Added to the cheat sheet.
2025-03-22factored out all cursor movement and deletion commands into the new ↵Robin Haberkorn4-599/+676
compilation unit move-commands.c * This made sense to include both `W` and `V`, so we also included `D` and `K`. `^Q` is included since it converts between lines and glyphs. * These are all single-letter commands, so they aren't complete parser states but callbacks to be referenced in teco_machine_main_transition_t.
2025-03-22harmonized all word-movement and deletion commands: they move/delete until ↵Robin Haberkorn8-34/+109
the beginning of words now * All commands and their documentations were inconsistent. * ^W rubbed out to the beginning of words. * Shift+Right (fnkeys.tes) moved to the beginning of the next word if invoked at the beginning of a word and to the end of the next word otherwise. * <W> (and <V> and <Y> by extension) moved to the end of the next word. * The cheat sheet would claim that <W> moves to the beginning of the next word. * Video TECO's <W> command would differ again from everything else. With positive arguments, it moved to the beginning of words, while with negative it moved to end of words. I decided not to copy this behavior. * It has been decided to adopt a consistent beginning-of-words policy. -W therefore differs from Video TECO in moving to the beginning of the current or previous word. * teco_find_words() is now based on parsing the document pointer, instead of relying on SCI_WORDENDPOSITION, since the latter cannot actually be used to skip strictly non-word characters. This requires a constant amount of Scintilla messages but will require fewer messages only when moving for more than 3 words. * The semantics of <W> are therefore now consistent with Vim and Emacs as well. * Shift+Right/Left is still based on SCI_WORDENDPOSITION, so it's behavior differs slightly from <W> for instance at the end of lines, as it will stop at linebreaks. * Unfortunately, these changes will break lots of macros, among others the M#rf, M#sp and git.blame macros ("Useful macros" from the wiki).
2025-03-21fixed rubout of Q-Register specificationsRobin Haberkorn5-4/+18
* This was a regression introduced by 257a0bf128e109442dce91c4aaa1d97fed17ad1a. * The undo token that frees newly allocated teco_machine_qregspec_t must actually reset the pointer as well since any subsequent token, pushed by teco_undo_qregspec_own(), will expect a valid pointer. * Could have been done via ctx->expectqreg = NULL; teco_undo_qregspec_own(ctx->expectqreg); but using a special clear function requires less memory and is easier to understand. * Added test case. This wouldn't always crash, but should definitely show up in Valgrind.
2025-03-21don't use TECO_DEFINE_UNDO_OBJECT_OWN() for what are essentially scalarsRobin Haberkorn2-8/+14
* The "own" objects are tricky to work with and have special requirements, so try to avoid them. * Also, wrap the push functions in macros like all other scalars. * This is a purely cosmetic change, but avoids some confusion.
2025-03-19fixup cddc9bf83eb5cd2c69626b31ae7373342523b626: errors must be printed ↵Robin Haberkorn1-6/+4
before cleaning up the interface This fixes crashes on Gtk.
2025-03-19fixup cddc9bf83eb5cd2c69626b31ae7373342523b626: avoid g_prefix_error_literal()Robin Haberkorn1-1/+1
This function requires glib v2.70, which impacted portability.
2025-03-19fixed leaking data on ruboutRobin Haberkorn5-16/+29
* Objects, that are restored with TECO_DEFINE_UNDO_OBJECT_OWN(), could actually leak memory on rubout since the old object was not deleted when overwriting it. * Now that it is, it is crucial to at least nullify objects/pointers after calling the corresponding push-function. These conditions are now explicitly documented. * The test suite now runs successfully under Valgrind even with full leak checking.
2025-03-17fixed leaking partially built string arguments in case of errorsRobin Haberkorn1-0/+1
* E.g. `@I/foo^EQ%/` whould fail if register `%` is missing. In batch mode, this would currently escalate and terminate the program. Only in this case, memory has been "leaked". This is not critical but was causing false positives in Valgrind. * Also, cleaning up properly might come in handy once we add error-catching constructs to the language.
2025-03-17free some global objects even in the error case, in order to appease ValgrindRobin Haberkorn1-14/+18
* If building with --enable-debug, we should always free all heap objects, even if they would be freed on program termination anway, so they won't appear as "possibly lost" in Valgrind. I had this missing if munged or evaled macro failed, which resulted in lots of false positives when running the testsuite under Valgrind. * Also fixes possible crashes due to reusing already set GError variables. This could theoretically happen if a munged script terminates with ^C and its "quit" ED-hook would also throw any error.
2025-03-17fixed memory leak when seeing an existing label (exactly the same or ↵Robin Haberkorn1-17/+15
redefinition) This could actually be reproduced by `./testsuite --valgrind` and by the Address Sanitizer.
2025-03-17test suite: perform leak checking when run under ValgrindRobin Haberkorn1-1/+1
This became the default in later Valgrind versions. With leak checking, the test suite does not currently run cleanly.
2025-03-16CI: fixup - CFLAGS should not expand to "false"Robin Haberkorn1-2/+2
2025-03-16CI: perhaps fixed address sanitizingRobin Haberkorn1-4/+9
It can be done only under ncurses, as Gtk results in many false positives. Also, try to use it on GCC and Clang. It didn't work with GCC on FreeBSD, but perhaps it will work on Ubuntu.
2025-03-16CI: enable address sanitizer when building with ClangRobin Haberkorn1-1/+3
As I cannot run the test suite with Valgrind in Github runners, this should still catch some memory bugs during test suite runs.
2025-03-16prefer native C/C++ compilersRobin Haberkorn1-6/+7
* The Autoconf defaults are actually biased in favor of GCC, so on systems with GCC and Clang, Autoconf would pick GCC. * Instead we now always default to `cc` and `c++`, i.e. the system's default compiler. * This means, we will compile with Clang by default on FreeBSD.
2025-03-16further improved monochrome terminal support: fixed reverse text on reverse ↵Robin Haberkorn4-28/+72
backgrounds * Unfortunately we cannot use `wbkgdset(win, A_REVERSE)` if we plan to use reverse text on this background, i.e. if we want to cancel out the background A_REVERSE. * SciTECO therefore no longer uses background attributes, but only foreground attributes. When setting a reverse text, we XOR A_REVERSE into the previous attributes. * This fixes control characters especially in the info line and popups, as well as rendering of the popup scroll bars. * The command-line should now be rendered properly even on a dark-on-bright color theme (which does not yet exist).
2025-03-15Curses: use special ellipsis symbol instead of "..." when truncating stringsRobin Haberkorn3-15/+38
This requires Unicode icon support to be enabled via ED. The ellipsis symbol is shorter and more distinctive, allowing more of the original text to be preserved before truncation.
2025-03-13updated Scinterm: my monochrome patch was merged only with some modificationsRobin Haberkorn3-8/+12
* SCI_COLOR_PAIR() is now a function teco_color_pair() since it also became an inline function in Scinterm.
2025-03-13rewrote <W> command on the same basis as <V> and <Y>Robin Haberkorn3-63/+68
* <W> was also using keyboard movement commands. * This fixes an inconsistency between the handling of punctuation characters, e.g. "(word" followed by -W vs. Y.
2025-03-12sciteco lexer: enable 2-char soft tabs by defaultRobin Haberkorn1-0/+4
* You practically never want to indent in SciTECO code with hard tabs, as the hard tab is an insertion command. * 2-char soft tabs are the convention in SciTECO's included macros. * Fixes the M#it macro among other things. * If you do want to insert an insertion-with-tab command (ASCII 9), you almost always will want to type it ^I instead. Real ASCII 9s should consequently be highlighted, ie. there should be a character representation. Unfortunately, character representations are currently set in C code and cannot be changed via <ES>.
2025-03-08Asciidoc, Markdown and Git lexers: enable word wrapping by defaultRobin Haberkorn3-0/+6
These are all more or less plain text formats.
2025-03-08added "email" lexer for writing mailsRobin Haberkorn3-1/+37
* Highlights both 1st level and 2nd level quotes and signatures. * This also sets the edge to 78 columns, as is recommended for email and enables word wrapping. The edge mode is not set, since it kind of looks ugly in Scinterm. * Helps when using SciTECO as the email editor for instance in the Aerc mail client. * Unfortunately, we cannot set up Scintilla to automatically break words after 78 columns (or perhaps that's a good thing). You can use the M#rf reformat-paragraph macro to reflow paragraphs before sending the mail. This will take the edge column into account even if no edge mode is set.
2025-03-08fixed the `Y` command: no longer delete any characters after dotRobin Haberkorn2-31/+28
* This has __always__ been broken. It's been especially annoying when pressing `Y` at the end of a line with trailing whitespace since the linebreak would also be deleted. This was because `Y` always deleted the entire word or non-word character-span. This was inconsistent with `V`. * We now use SCI_WORDSTART|ENDPOSITION instead of the keyboard commands. It therefore also requires less Scintilla messages (4+2*n vs. 4+4*n). Most importantly, we can now check for errors before changing the buffer, so there is no need to undo anything in case of errors. This should always be the preferred strategy. * Added test case.
2025-03-08README: added repology badges for some of the repositoryRobin Haberkorn1-1/+5
This will at least show the currently packaged versions on the website.