| Age | Commit message (Collapse) | Author | Files | Lines |
|
This currently only works in insert commands after enabling the immediate
editing modifier via CTRL+G and if the LSP was already launched
(e.g. by an explicit `FT$`).
File name completions are still performed with an activated ^G modifier
only if the LSP is shut down.
Just like for file names, the modifier is automatically cancelled after
a successful completion - there is little sense in completing several
symbols in a row.
|
|
This will be important once we're doing LSP auto-completions.
Until a completion is complete, we do NOT want to disable the modifier however
since otherwise it can be disabled after a partial completion if there happened
to be a rubbed out command line.
Discarding a rubbed out command line consequently no longer disables
the modifier as well.
Any change of the modifier is now logged with an Info-level message.
Some rudimentary test case has been added for rub-in via ^G.
|
|
This is similar to `\` at the line end in many languages like C and
allows you to split a very long string argument over several lines without
adding the EOL characters themselves.
The TECO equivalent to `\` would be ^Q, but it would be a semantic exception since
^Q (escaping) is supposed to _preserve_ the value of the following character.
Therefore I decided to use ^E instead.
This works with DOS and Mac line breaks as well.
|
|
exclusively
Previously we were using both Scintilla undo actions and our own undo tokens
and both had to be coordinated via `undo__teco_interface_ssm(SCI_UNDO, 0, 0)`.
This was error prone since we have to predict when an undo action is actually
generated. Furthermore, you had to update SCI_SETUNDOCOLLECTION on all buffers
and the Q-Reg view whenever switching to and from interactive mode.
Also, this probably wasted memory for the doubled undo bookkeeping.
Now, we always set SCI_SETUNDOCOLLECTION(FALSE), even in interactive mode.
teco_undo_view_insert() was introduced to undo text deletions.
While this saves almost no lines of code, it's just a clearer and simpler
architecture.
|
|
This can be read by clangd as an alternative to compile_commands.json
(which would be trickier to generate with Autotools).
However, since this is generated in the build directory, it may not always
be picked up automatically -- a build/ directory should work,
but otherwise you might have to pass --compile-commands-dir to clangd.
|
|
That was only for 2.5.2_1.
|
|
* These are defined by C23 and jemalloc actually provides them
beginning with FreeBSD 16.
Since glib is using free_sized() when available, builds were broken
on FreeBSD 16.
* Should be backported to the SciTECO 2.5.2 FreeBSD port to
silence the fallout.
|
|
For yet unknown reasons this does not improve performance on GCC 16
even though it also supports `__attribute__((musttail))`.
As long as I do not understand why, I don't want to risk any
unnecessary problems. I have reason to believe that the tail-call
optimized version still has subtle bugs.
See also the "tail-calls" branch.
This reverts commit 2e097cec409182c3cb39b74489387480bf8a278f.
|
|
Now use the teco_spawn_check_wait_status(), which was previously in spawn.c,
so we no longer have to handle the UNIX-specific WEXITSTATUS() macros.
|
|
teco_qreg_table_get_integer()
* Simplifies the common task of querying an integer or string from a Q-Register table.
* Undefined Q-Regs are reported as TECO_ERROR_QREGUNDEF, so you can theoretically
handle this case. In practice however, it requires less boilerplating to
just call teco_qreg_table_find() manually.
* It also doesn't make sense to use these functions when getting and setting
a register at the same time as you will want to avoid repeated lookups.
|
|
* On newer GCC (>= 15) and Clang (>= 13) versions we can tail call
at the end of input_cb() implementations to the next state's input_cb(),
which will be optimized to jumps (often direct jumps).
That is, the compilers always optimized tail calls, but we can
guarantee tail calls with the __attribute__((musttail)) statement
attribute.
* Every `return &teco_state_xxx` has to be replaced with
`TECO_RETURN(ctx, &teco_state_xxx, error)`.
* This speeds up `-O2 -flto` builds by 18%
(e.g. tested on grosciteco for sciteco(7)).
Part of the speed up could also be because of inlining through
TECO_RETURN().
* The other state machines (stringbuilding and q-reg spec) cannot
currently be optimized the same way since they get their characters
passed in from the "main" state machine.
* All loops around callbacks could be optimized the same way.
E.g. the undo token runner could also tail call into the next runner,
but it's probably not important to optimize undo token executions.
|
|
See also 8a8edaa2daf37f7c12e21b9199755b5de8e489f5.
|
|
These can fail, so abort() just like glib does internally in case of OOM.
A special case is the pad allocation for autocompletion popups, which
can have excessively many lines. This is handled gracefully now
(the popup simply won't be displayed).
|
|
* It sends `null` instead of empty lists, even though this is violating the LSP specs.
* Filter out duplicates from the auto-completion lists.
This may benefit other servers as well.
* ctags-lsp does not fuzzy search for workspace/symbol, so auto-completions
aren't really a thing.
The only special case is sending the empty string, which results in
all symbols being returned. This can be slow, though.
* ctags-lsp does not support textDocument/references, so n:FT$ won't be supported.
|
|
* We use 23 now as the "id" for all JSON-RPC requests.
* Every message with a different "id" can be ignored,
as it is a request, we haven't advertised to support.
Alternatively, we should perhaps send an error response to
unexpected requests?
* Fixes support for the ccls server which sends window/workDoneProgress/create
even though I didn't advertise it.
ccls cannot practically be used with FTsymbol$ though since it returns
full declarations.
You can perform a fuzzy symbol search, though.
|
|
If you have projects in different languages you can set different LSPs.
The default will still come from ~/.teco_ini if you decide to set one.
The default for $SCITECO_LSP_ROOT is set by session.tes' VCS integration
based on the VCS root, but you could still overwrite it per session.
|
|
Should fix Windows builds.
|
|
* The main interface is the `FT` command.
`FT` was an undocumented Video TECO command for etags/ctags lookups.
I don't want to exactly copy its interface, though.
* `FT` allows looking up symbol names,
definitions and references.
* ctags will be supported via ctags-lsp.
LSP support is more powerful though and works without
regenerating TAGS files all the time.
The LSP will also allow you to customize auto-completions
using SciTECO itself (i.e. by writing a language server
in SciTECO).
* For multiple results, `FT$` can be used to cycle through
results - this should mimic repeated `S$` or `N$`.
* `:FT...$` does a fuzzy search. IMHO it's not important
to return a status integer instead. `FT` will only
really be used in interactive mode.
* Document synchronization is supported via hooks from
ring.c and via Scintilla notifications.
* Currently, the LSP communication is based on blocking
GIOChannels. This means that a misbehaving hanging
server could "lock up" the entire editor (FIXME).
Only on ncurses you can always kill the subprocess by
pressing CTRL+C.
We need helper functions in spawn.c to read and write
with interruptions.
* The textDocument/didChange notification transmits
not only all edits, but all files' contents as well
during initial synchronization.
Therefore it is optimized to write and JSON-escape
data without copying them around in memory and without
destroying the buffer gap.
* Use $SCITECO_LSP to configure the language server.
You can also use `tee` to capture stdin and stdout.
Perhaps $SCITECO_LSP should be saved in .teco_session,
so you can change it between projects?
* $SCITECO_LSP_ROOT is used to point to the project's
root directory. session.tes will set it up automatically.
|
|
It will be useful for implementing LSP support.
It does not have JSON escape/unescape functions, so those
will still have to be written.
Source: https://github.com/rxi/sj.h
|
|
|
|
characters
This fixes insertion of strings containing ^, ^P, ^Q, ^R, ^V, ^W, ^E.
It mainly affects Q-Register specification auto-completions, but filenames
could theoretically also contain such special characters.
|
|
* Should fix some of the Groff-rendered pages which used Unicode symbols.
* Not hotlinking to nerdfonts.com hopefully improves SEO.
Perhaps this prevented indexing!?
|
|
* This has been broken for some time, but it didn't crash in v2.5.2.
* Even when it did not crash, the search just failed.
In TECO-11 (judging by TECOC), we must throw an error, though.
Video TECO on the other hand always succeeds in such cases.
* Added test case
|
|
I am unsure why it now suddenly causes problems.
pkg2appimage appears to download the appimagetool.
|
|
wine64 nowadays appears to require a 32-bit Wine as well, so replace
it with wine64.bin.
The quasi-msys2 python3 could theoretically also be launched with
wine64.bin, but I prefer to run it with the FreeBSD-native python3.
|
|
quasi-msys2 apparently overwrites python3 with a win32 version.
This no longer works without installing a 32-bit Wine version.
Instead, I now force it to run with the native FreeBSD python3.
|
|
It was missing a few files.
Should also fix CI runs.
|
|
--disable-malloc-replacement
sys/user.h draws in some header from openbsm, so we install it
as well into the freebsd14-sciteco container.
Should fix CI builds.
|
|
If you had a partial success during interactive searching, dot would be
left at that position since the failure handling only reset via SCI_GOTOPOS.
This is now fixed by restoring the initial dot in glyphs as well.
All existing occurrences of "dot" have been renamed to "pos" for consistency.
(Nowadays, "dot" should be reserved for glyph positions since this is what
`.` returns. Especially if both kinds of positions are used in the same code.)
A test case has been added.
This has been broken since 685507922b0b75da5935076395a5b1ec1ef58356.
|
|
* Atomics are much cheaper than mutexes for such rarely contented
fields, but they are still much slower than plain arithmetics.
* For realloc(), we'd expect relatively small changes between calls
which means that the chunk's usable size probably won't change.
Therefore it makes sense to check whether we'd get a zero addition
to teco_memory_usage.
* We will now have at most one atomic add in realloc() instead of
always 2 atomic operations.
|
|
|
|
|
|
It can also be useful for spawning $SCITECO_CLIPBOARD_SET/GET processes (currently via popen())
and for launching language servers.
|
|
Otherwise, valgrind won't be able to detect malloc()/free() misuse.
In other words, CI-driven Valgrind checks have always been broken.
|
|
But I doubt that get_string() could in practice fail on the plain
environment variable Q-Regs. So this was never triggered.
|
|
* 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.
|