| Age | Commit message (Collapse) | Author | Files | Lines |
|
* 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.
|
|
* 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.
|
|
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 '\''.
|
|
`*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.
|
|
|
|
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).
|
|
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.
|
|
* Always use ^ENq instead of ^EQq in the first argument of `EN`.
* Added a "Globbing" test case - globbing was undertested anyway.
|
|
* 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>`.
|
|
Inlining the macro calls no longer results in a 25% speedup.
|
|
Building documentation is slow, so this speeds up
development-test cycles.
|
|
|
|
* 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).
|
|
* 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.
|
|
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.
|
|
* 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().
|
|
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.
|
|
* 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().
|
|
It for some strange reason had to be escaped for AREs
even though a single freestanding `)` cannot mean anything.
|
|
This for the first time mentions all of the bundled core libraries
in the end user documentation.
|
|
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.
|
|
The calculation of the block start was faulty and could cause underflows
resulting in unpredictable behavior.
|
|
regular expression
|
|
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.
|
|
It's now a private struct, so we can include the regex_t wihout
having to draw in the terex headers everywhere.
|
|
* 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/
|
|
|
|
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.
|
|
|
|
* 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
|
|
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.
|
|
* 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.
|
|
* 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.
|
|
This would be a C23 extension.
|
|
* 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.
|
|
* 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.
|
|
This has been broken since v2.5.2.
|
|
* Instead of supporting only 16 predefined RGB placeholder
values in Scintilla messages and styles, you can now use
arbitrary RGB values and colors are allocated via the terminal
on the fly.
You no longer need to call 3EJ to change the default color
palette.
* The placeholder RGB values are still available.
Since you will usually want exact RGB values when using
anything outside of the range of 16 default colors
and the RGB placeholders will not always exactly correspond
to their RGB value, you can now call `0,3EJ` to ignore
the default palette and allocate all colors dynamically.
* Allows for more than 16 colors on the screen simultaneously.
Also simplifies the solarized.tes color scheme.
Since both Scinterm and SciTECO try not to touch the 16
default colors, you also no longer have to deal with
restoring the palette after program termination
(which was never reliable anyway).
* Color schemes with non-default colors (solarized.tes)
may now be broken on TERM=linux-16color (Linux VT)
since Scinterm will get only 8 colors, but solarized.tes
needs 16.
|
|
|
|
This was especially dangerous since the introduction of
a message level parameter, which could still be popped from
the expression stack in parse-only mode or during lexing.
This effectively broke n^A interactively in GTK.
|
|
|
|
index on the correct view
* Had been broken since introduction in v2.3.0.
* This slowed down EQq<filename>$ on large files.
|
|
* signal() sets SA_RESTART by default.
* Some syscalls can theoretically block indefinitely.
Even opening a special file could result in an indefinitely
blocking operation, that should be interruptible.
You must still poll teco_interrupted in these read() loops of course.
* Also makes sure that clipboard operations are interruptible
even if $SCITECO_CLIPBOARD_GET blocks.
Although I couldn't provoke problems in practice,
I did observe hangs with xclip on Wayland on Linux,
that could only be resolved by manually killing xclip.
|
|
has been merged
|
|
* The GTK version logs additional warnings, so we cannot
match verbatim against stderr.
Instead we only look for a line beginning with `Warning:` or `Error:`.
* We now also test info messages (`1^A`).
|
|
* Scinterm was simply rendering them as black, thus effectively
breaking the Linux and FreeBSD vts with terminal.tes.
* I was considering to render light black as white on 8-color terminals,
so it's always readable.
However, if you add in A_BOLD there is a good chance that the
color will end up grey - at least it does in the virtual terminals (consoles).
* There is no need to use bright colors in the Scintilla view defaults.
E.g. 0xFFFFF is "light white".
However on 8-color terminals this will be rendered like white anyway.
The new defaults are closer to what terminal.tes does.
|
|
* I.e. you can now log warnings and errors from SciTECO code as well.
* We do not need a version of ^A accepting code points, since this is
supported by ^T already.
|
|
recovery `#files#`
* This could have been in ring.c, but in the future we may want to script
the behavior in case recovery files are detected.
* The warnings are currently written as user messages, which looks
ugly in interactive mode.
Once n^A is supported, we can write them as regular warnings, though (FIXME).
|
|
and indention settings
* Go-to statement was broken since v2.5.0.
* see also b65c64a200dac8194dacc90ae2150b683f64cd8a
|
|
* SIGTERM used to insert the ^KCLOSE key macro.
However with the default ^KCLOSE macro, which inserts `EX`,
this may fail to terminate the editor if buffers are modified.
If the process is consequently killed by a non-ignorable signal,
we may still loose data.
* SIGTERM is used to gracefully shut down, so we now always terminate.
Since we have recovery files, they are now dumped before terminating.
This makes sure that recovery files are more up-to-date during
unexpected but gracefull terminations.
* The same functionality is planned on Curses, but requires more fundamental
changes (TODO).
|