aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2024-12-23Curses: don't install PNG iconsRobin Haberkorn4-10/+7
* They are used at runtime only by the GTK port. * Their existence can cause problems if OS-specific build systems have to clean these files from the staging directory afterwards. This was the case on FreeBSD where the committer refused to remove these files after installation. In the official FreeBSD port, we therefore currently ship the PNG icons unnecessarily. * They are now installed and shipped only on GTK builds.
2024-12-23uploaded target release to v2.3.0Robin Haberkorn2-2/+2
2024-12-22freebsd port: enabled LTORobin Haberkorn1-0/+2
This is not done automatically when building ports. The FreeBSD binaries were thus the only ones without LTO. We should prefer WITH_LTO, even once we add something like --enable-lto, as WITH_LTO enables Clang-specific ThinLTO support.
2024-12-22updated TODORobin Haberkorn1-17/+26
2024-12-22Curses: fixed inserting null-byte (^@) by pressing Ctrl+@Robin Haberkorn1-3/+3
* g_utf8_get_char_validated() returns -2 for null-bytes (sometimes!?)
2024-12-22fixed lexing (syntax highlighting) of the null-character (^@) in SciTECO codeRobin Haberkorn3-4/+8
* Apparently g_utf8_get_char_validated() sometimes(!) returns -2 for null-characters, so it was considered an invalid byte sequence. * What's strange and unexplainable is that other uses of the function, as are behind nA and nQq, did not cause problems and returned 0 for null-bytes. * This also fixes syntax higlighting of .teco_session files which use the null-byte as the string terminator. (.teco_session files are not highlighted automatically, though.)
2024-12-22fixed indention in interface-curses/interface.cRobin Haberkorn1-9/+9
This is a purely cosmetic change.
2024-12-22fixed crashes while setting special Q-Registers with EU (string-building ↵Robin Haberkorn3-7/+17
characters) * The teco_qreg_vtable_t::get_string() method should support returning the length optionally (may be NULL). This already worked with teco_doc_get_string(), even though it wasn't documented, and therefore didn't cause problems with regular Q-Registers.
2024-12-22support external Scintilla lexer libraries and Scintillua in particularRobin Haberkorn5-12/+124
* @ES/SCI_SETILEXER/lib^@name/ now opens the lexer <name> in library <lib>. * You need to define the environment variable $SCITECO_SCINTILLUA_LEXERS to point to the lexers/ subdirectory (containing the *.lua files). Perhaps this should default to the dirname of <lib>? * The semantics of SCI_NAMEOFSTYLE have been changed: It now returns style ids when given style names, so you can actually write Scintillua lexer *.tes files. This will be superfluous if we had a way to return strings from Scintilla messages into Q-Registers, e.g. 23@EPq/SCI_NAMEOFSTYLE/. * We now depend on gmodule as well, but it should always be part of glib. It does not change the library dependencies of any package. It might result in gmodule shared libraries to be bundled in the Win32 and Mac OS packages if they weren't already.
2024-12-21slightly improved the hash bang replacement on SciTECO scripts after ↵Robin Haberkorn1-1/+1
installation * use the new ::FS and ^Q commands
2024-12-17freebsd port: synced with the version in FreeBSD portsRobin Haberkorn2-2/+3
Rodrigo Osorio re-included the PNGs even for sciteco-curses. Should be fixed at the Autoconf-level, by only installing the PNGs on GTK.
2024-12-17updated Scintilla to v5.5.4: contains a few optimizationsRobin Haberkorn1-0/+0
Unfortunately, it does not help with the slowdowns when editing files with very long lines.
2024-12-17sped up opening very large UTF-8 files by temporarily disabling the ↵Robin Haberkorn1-11/+33
line-character index * checks for character consistency (of UTF-8 byte sequences) were slowing down things significantly in Scintilla * It got even worse if the file indeed contained non-ANSI codepoints as reading in chunks of 1024 would sometimes mean that incomplete byte sequences would be read. Some large 160mb test files wouldn't load even after minutes. They now load in seconds. * This does NOT yet solve the slowdowns when operating on very long lines.
2024-12-16README: mention FreeBSD port and added link to the newsgrouper.org.uk web ↵Robin Haberkorn2-5/+11
frontend to alt.lang.teco * This appears to be the only remaining working web frontend to alt.lang.teco. * There is https://www.usenetarchives.com/threads.php?id=alt.lang.teco which has an archive of very old posts, which is cool, but they appear to have stopped synchronizing somewhere around 2022. * https://alt.lang.teco.narkive.com/ is broken and also not fully synchronized. * Google Groups stopped working in February 2024. * The FreeBSD port isn't yet in any quartely branch, so it's unlikely somebody can just pkg install it (yet).
2024-12-14README/NEWS: better use links to the Libera webchat - Github does not render ↵Robin Haberkorn2-2/+2
ircs-URLs (refs #29)
2024-12-14README: mention the new IRC chatroomRobin Haberkorn2-4/+2
2024-12-14update sciteco.tes: this again highlights commands, but not Q-Register namesRobin Haberkorn1-2/+2
It's a bit easier on the eyes.
2024-12-14fixed ^Y after FK...$: take the deleted text into accountRobin Haberkorn1-2/+8
* I.e. you can now write FK...$^YD to delete up to AND the matched pattern.
2024-12-13SciTECO lexing: fixed styling of commands after dollar or escape (when used ↵Robin Haberkorn1-1/+2
as a separate command)
2024-12-13fixed lexer.checkheader: restore dot in case of successRobin Haberkorn1-1/+1
2024-12-13fixup 244a54a18b7db6af177c9d10f3224772f08d7484: abuse the Scintilla view's ↵Robin Haberkorn3-11/+13
"identifier" to enable lexing in the container * SCI_SETILEXER(NULL) is not a reliable way to do that since that's the default for all views. * This was breaking the git.tes lexer for instance and was unnecessarily driving teco_lexer_style() on plain-text documents. * Since we currently do not implement the ILexer5 C++ interface and teco_view_t is just a pointer alias, we are abusing the view's "identifier" instead. This is probably sufficient, as long as there is only one lexer "in the container". Otherwise, there should perhaps be a single C++ class that does nothing but wrapping a callback into an ILexer5 object with a C ABI.
2024-12-13document the FK...$^SR idiomRobin Haberkorn3-2/+3
* We don't actually have to negate ^S results after FK. For deleting the matched pattern, you can use ^YD or -^SD.
2024-12-13updated README: mention community resourcesRobin Haberkorn1-0/+10
2024-12-13updated INSTALL: how to install dependencies on Fedora and FreeBSDRobin Haberkorn1-0/+10
2024-12-13implemented Scintilla lexer for SciTECO code, i.e. TECO syntax highlightingRobin Haberkorn19-27/+362
* this works by embedding the SciTECO parser and driving it always (exclusively) in parse-only mode. * A new teco_state_t::style determines the Scintilla style for any character accepted in the given state. * Therefore, the SciTECO lexer is always 100% exact and corresponds to the current SciTECO grammer - it does not have to be maintained separately. There are a few exceptions and tweaks, though. * The contents of curly-brace escapes (`@^Uq{...}`) are rendered as ordinary code using a separate parser instance. This can be disabled with the lexer.sciteco.macrodef property. Unfortunately, SciTECO does not currently allow setting lexer properties (FIXME). * Labels and comments are currently styled the same. This could change in the future once we introduce real comments. * Lexers are usually implemented in C++, but I did not want to draw in C++. Especially not since we'd have to include parser.h and other SciTECO headers, that really do not want to keep C++-compatible. Instead, the lexer is implemented "in the container". @ES/SCI_SETILEXER/sciteco/ is internally translated to SCI_SETILEXER(NULL) and we get Scintilla notifications when styling the view becomes necessary. This is then centrally forwarded to the teco_lexer_style() which uses the ordinary teco_view_ssm() API for styling. * Once the command line becomes a Scintilla view even on Curses, we can enabled syntax highlighting of the command line macro.
2024-12-10updated NEWS: mentioned new releaseRobin Haberkorn1-0/+3
2024-12-10fixed compiler warnings when building release buildsRobin Haberkorn1-2/+2
* g_assert() apparently does not reference the expression when assertions are disabled in contrast to glibc's assert()
2024-12-09updated Debian package for v2.2.0 releaseRobin Haberkorn1-0/+6
2024-12-09updated FreeBSD package to v2.2.0Robin Haberkorn3-34/+36
2024-12-09prepared v2.2.0 releasev2.2.0Robin Haberkorn3-31/+107
This release is mainly for the upcoming FreeBSD package.
2024-12-08fixed rubbing out file open with glob patternsRobin Haberkorn1-5/+4
* This would crash if <EB> opened more than one file, e.g. EB*.c$. The reason is that teco_current_doc_undo_edit() must be called before every teco_ring_edit(). * Unfortunately, this is not reproduceable with sciteco --no-profile --fake-cmdline '@EB"foo*.txt"{HK}' since the crashes actually happen when printing messages in interactive mode. That's why no test case has been added.
2024-12-08implemented the ^Q command for converting between line and glyph positionsRobin Haberkorn4-7/+76
* As known from DEC TECO, but extended to convert absolute positions to line numbers as well. :^Q returns the current line. * Especially useful in macros that accept line arguments, as it is much shorter than something like ^E@ES/LINEFROMPOSITION//+Q.l@ES/POSITIONFROMLINE//:^E-. * On the other hand, the fact that ^Q checks the line range means we cannot easily replace lexer.checkheader with something like [:J 0,^Q::S...$ ]: Using SCI_POSITIONFROMLINE still has the advantage that it returns `Z` for out-of-bounds ranges which would be cumbersome to write with the current ^Q. * Perhaps there should be a separate command for converting between absolute lines and positions and :^Q should be repurposed to return a failure boolean for out-of-range values? * fnkeys.tes could be simplified.
2024-12-06support the ::S anchored search (string comparison) command (and ::FD, ::FR, ↵Robin Haberkorn15-72/+130
::FS as well) * The colon modifier can now occur 2 times. Specifying `@` more than once or `:` more than twice is an error now. * Commands do not check for excess colon modifiers - almost every command would have to check it. Instead, a double colon will simply behave like a single colon on most commands. * All search commands inherit the anchored semantics, but it's not very useful in some combinations like -::S, ::N or ::FK. That's why the `::` variants are not documented everywhere. * The lexer.checkheader macro could be simplified and should also be faster now, speeding up startup. Eventually this macro can be made superfluous, e.g. by using 1:FB or 0,1^Q::S.
2024-12-05nightly builds: use Mac OS 13 instead of the deprecated version 12Robin Haberkorn1-1/+1
* 13 is now the oldest supported version
2024-12-05updated NEWS: mention the chatroom pollRobin Haberkorn1-2/+2
2024-12-04use the new ^Y, ^S and @Xq commands in tedoc.tes and string.tesRobin Haberkorn2-7/+7
2024-12-04the <Xq> command now supports the @ modifier for cutting into the registerRobin Haberkorn6-12/+79
* Can be freely combined with the colon-modifier as well. :@Xq cut-appends to register q. * This simply deletes the given buffer range after the copy or append operation as if followed by another <K> command. * This has indeed been a very annoying missing feature, as you often have to retype the range for a K or D command. At the same time, this cannot be reasonably solved with a macro since macros do not accept Q-Register arguments -- so we would have to restrict ourselves to one or a few selected registers. I was also considering to solve this with a special stack operation that duplicates the top values, so that Xq leaves arguments for K, but this couldn't work for cutting lines and would also be longer to type. * It's the first non-string command that accepts @. Others may follow in the future. We're approaching ITS TECO madness levels.
2024-12-04implemented ^Y/^S commands for receiving pattern match/insertion ranges and ↵Robin Haberkorn8-25/+224
lengths (refs #27) * Allows storing pattern matches into Q-Registers (^YXq). * You can also refer to subpatterns marked by ^E[...] by passing a number > 0. This is equivalent to \0-9 references in many programming languages. * It's especially useful for supporting TECO's equivalent of structural regular expressions. This will be done with additional macros. * You can also simply back up to the beginning of an insertion or search. So I...$^SC leaves dot at the beginning of the insertion. S...$^SC leaves dot before the found pattern. This has been previously requested by users. * Perhaps there should be ^Y string building characters as well to backreference in search-replacement commands (TODO). This means that the search commands would have to store the matched text itself in teco_range_t structures since FR deletes the matched text before processing the replacement string. It could also be made into a FR/FS-specific construct, so we don't fetch the substrings unnecessarily. * This differs from DEC TECO in always returning the same range even after dot movements, since we are storing start/end byte positions instead of only the length. Also DEC TECO does not support fetching subpattern ranges.
2024-11-30sciteco(7): fixed outdated information about the STYLE_CALLTIP default colorsRobin Haberkorn1-3/+3
2024-11-30updated Scinterm to the official v5.2 releaseRobin Haberkorn1-0/+0
This does not change anything functionally.
2024-11-25fixed operator precedence application (fixup ↵Robin Haberkorn2-7/+12
5597bc72671d0128e6f0dba446c4dc8d47bf37d0) * Using teco_expressions_eval() is wrong since it does not pay attention to precedences. If you have multiple higher precedence operators in a row, as in 2+3*4*5, the lower precedence operators would be resolved prematurely. * Instead we now call teco_expressions_calc() repeatedly but only for lower precedence operators on the stack top. This makes sure that as much of the expression as possible is evaluated at any given moment.
2024-11-25avoid dynamic stack allocation in teco_expressions_brace_return()Robin Haberkorn1-4/+1
* This is not safe since the size of the stack object comes from the "outside" world, so stack overflows can theoretically be provoked by macros.
2024-11-25fixed subtle operator precedence bugRobin Haberkorn2-1/+7
* It was possible to provoke operator right-associativity when placing a high-precedence operator between two low-precedence operators. 1-6*5-1 evaluated to -28 instead of the expected -30. * The reason is that SciTECO relies on operators to be resolved from left-to-right as soon as possible. The higher precedence operator prevents that and pushing the 2nd "-" only evaluated 6*5. At the end 1-30-1 would be left on the stack. teco_expressions_eval() however evaluates from right-to-left which is wrong in this case. * Instead, we now do a full eval on every operator with a lower precedence, making sure that 1-30 is evaluated first.
2024-11-24sciteco(7): minor documentation fixRobin Haberkorn1-1/+1
2024-11-24lexer.auto: use case-sensitive searchesRobin Haberkorn1-0/+0
* lexer.checkheader is therefore case-sensitive now as well
2024-11-24added special Q-Register ":" for accessing dotRobin Haberkorn9-15/+76
* We cannot call it "." since that introduces a local register and we don't want to add an unnecessary syntactic exception. * Allows the idiom [: ... ]: to temporarily move around. Also, you can now write ^E\: without having to store dot in a register first. * In the future we might add an ^E register as well for byte offsets. However, there are much fewer useful applications. * Of course, you can now also write nU: instead of nJ, Q: instead of "." and n%: instead of "nC.". However it's all not really useful.
2024-11-24minor documentation changes: use typographic quotes instead of "Robin Haberkorn2-3/+3
2024-11-23string building: ^c (caret+c) does no longer expand to data garbage for ↵Robin Haberkorn1-0/+9
non-control characters, but to the literal caret, followed by c * For instance `^$` would insert two characters. * The alternative would have been to throw an error.
2024-11-23disallow setting the radix to values lower than 2Robin Haberkorn3-8/+34
* This would actually causes crashes when trying to format numbers. * The ^R local register has a custom set_integer() method now, so that the check is performed also when using nU.^X.
2024-11-23the search mode and current radix are mapped to __local__ Q-Registers ^X and ↵Robin Haberkorn12-56/+185
^R now (refs #17) * This way the search mode and radix are local to the current macro frame, unless the macro was invoked with :Mq. If colon-modified, you can reproduce the same effect by calling [.^X 0^X ... ].^X * The radix register is cached in the Q-Reg table as an optimization. This could be done with the other "special" registers as well, but at the cost of larger stack frames. * In order to allow constructs like [.^X typed with upcarets, the Q-Register specification syntax has been extended: ^c is the corresponding control code instead of the register "^".