Age | Commit message (Collapse) | Author | Files | Lines |
|
* Useful for packaging on platforms where we can only build from tarballs (FreeBSD)
* I don't know whether it's always safe and correct to install this file into $DATADIR/applications,
so the file is only distributed but not installed yet.
* It contains a hardcoded binary name "gsciteco". This could actually differ
depending on the concrete --program-prefix and it would be good to include the exact
installation path.
This however is not possible as long as we do not install this file.
|
|
* This is also the base of $SCITECOPATH.
* Changing it is useful for packaging where it is not possible to factor out the common
files between Curses and Gtk builds into a "sciteco-common" package.
As an alternative, you can now create disjunct sciteco-curses and sciteco-gtk packages.
* You will most likely want to use this for Gtk builds as in:
--with-interface=gtk --program-prefix=g --with-scitecodatadir=/usr/local/share/gsciteco.
|
|
* Since Scintilla no longer automatically scrolls the caret (see 941f48da6dde691a7800290cc729aaaacd051392),
the caret wouldn't always end up in the view on startup.
* Added teco_interface_refresh() which includes SCI_SCROLLCARET and
is invoked on startup. This helps with the Curses backend.
It also reduces code redundancies.
* On Gtk, the caret cannot be easily scrolled on startup as long as no size is allocated
to the window, so we also added a size-allocate callback to the
window's event box. Sizes are less often allocated to the event box than to the
window itself for some strange reason.
|
|
* This probably did not cause any bugs.
|
|
default now
* On FreeBSD both the dlmalloc replacement and poll-thread via sysctl() work
but the poll-thread has been benchmarked to be significantly faster,
at least on my machine.
You can still ./configure --enable-malloc-replacement of course.
* Interestingly, the RSS of the process visible via htop does not decrease
after OOMs or command-line terminations - with neither of the implementations.
|
|
* This especially fixes spawning on 0,128ED-mode broken since
f557af9a9112955d3b65f6ad0d54c0791189f961.
* The process is added to a job object now, which allows us to
kill the entire process tree.
Previously we we were leaving around orphaned processes.
|
|
|
|
* teco_interrupt() turned out to be unsuitable to kill child processes (eg. when <EB> hangs).
Instead, we have Win32-specific code now.
* Since SIGINT can be ignored on UNIX, pressing CTRL+C was not guaranteed to kill the
child process (eg. when <EB> hangs).
At the same time, it makes sense to send SIGINT first, so programs can terminate gracefully.
The behaviour has therefore been adapted: Interrupting with CTRL+C the first time will kill
gracefully. The second time, a more agressive signal is sent to kill the child process.
Unfortunately, this would be relatively tricky and complicated to do on Windows, so CTRL+C will always
"hard-kill" the child process.
* Moreover, teco_interrupt() killed the entire process on Windows when called the second time.
This resulted in any interruption to terminate SciTECO unexpectedly when tried the second time on Gtk/Win32.
* teco_sigint_occurred renamed to teco_interrupted:
There may be several different sources for setting this flag.
* Checking for CTRL+C on Gtk involves driving the main event loop repeatedly.
This is a very expensive operation. We now do that only every 100ms. This is still sufficient since
keyboard input comes from humans.
This optimization saves 75% runtime on Windows and 90% on Linux.
* The same optimization turned out to be contraproductive on PDCurses/WinGUI.
|
|
* test case: ECwhile true; do true; done$
* Some platforms require polling via teco_interface_is_interrupted()
for detecting interruptions, so we added an idle watcher to the
Glib event loop in spawn.c.
* On platforms that do not require polling key presses (like Unix/ncurses),
the idle watcher won't do any harm.
|
|
* The caret wasn't always kept out of the UZ and at some point would totally leave the view.
This was apparently cause by executing two SCI_SCROLLCARETs per teco_interface_cmdline_update().
* Instead, we now use a CARET_EVEN scroll policy which also works sufficiently well.
|
|
* This is using an Input Method now.
* Entering dead keys has probably always been broken in Gtk which I only did not notice
because I use a keyboard layout without dead keys.
This affects the ^ and ` keys on a German layout.
* Once we support Unicode input, it would make sense to abuse Scintilla's already existing input method support.
Unfortunately, forwarding keyboard events to the Scintilla view breaks event freezing and results in flickering.
|
|
PDCurses/WinGUI
* we can neither display, nor parse Unicode characters properly, so this does not worsen anything
* makes it harder to confuse the parser as long as we do not support Unicode.
* behaves like on Gtk: pressing a non-ASCII char will simply be ignored
* Most importantly, this fixes crashes on PDCurses/WinGUI.
It apparently couldn't handle the negative integers that resulted from passing a value >= 0x80 <= 0xFF
into gchar (which is a signed integer).
Changing everything into guchar is not worth the effort - we need full Unicode support anyway.
|
|
g_object_unref()
* Turns out that using gtk_widget_destroy(), the finalize handler never gets called!?
This means we were leaking memory.
* Using g_object_unref() fixes that and the initial Scintilla patch is no longer necessary.
* There have previously been use-after-free bugs when *not* using gtk_widget_destroy().
This has apparently been fixed in the meantime in Scintilla.
|
|
* Turns out it is impossible - or at least very tricky - to avoid undo token emission
for insert_len.
I therefore opt for stability rather than saving memory.
* The old workaround introduced in a6b5394086260c262e393dd113057916fd14134b would actually
fail if you do not rub out the string argument completely after interruption. I.e.
You type <Ihello^J$>, interrupt - insert_len may be != 0 at this point - and _partially_
rubout the insert-command and continue typing.
This could still crash the editor.
|
|
Scintilla now
* The patch avoids all automatic scrolling consistently, including in SCI_UNDO.
This speads up Undo (especially after interruptions).
* Also, the patch disables a very costly and pointless (in SciTECO) algorithm that
effectively made <Ix$> uninterruptible.
* Effectively reverts large parts of 8ef010da59743fcc4927c790f585ba414ec7b129.
I have never liked using unintuitive Scintilla messages to avoid scrolling.
|
|
* actually everything is updated to their current HEADs but the aforementioned versions are close.
* Scintilla uses threads now, so we added checks for pthread.
To be on the safe side, we imported AX_PTHREAD from the Autoconf archives.
The flags are kept out of the ordinary build system, though and used only for compiling Scintilla
and for linking.
SciTECO may also use threads, but via Glib.
* Scinterm removed SCI_COLOR_PAIR(), so we re-added it to src/interface-curses/interface.c.
* There is an Asciidoc lexer now.
* The <Ix$> interruption bug (see TODO) is not fixed by this upgrade.
Perhaps the Mac OS version runs better now. Feedback is needed (refs #12).
|
|
* In order to provoke this bug, there must be a loop with a string command.
For instance <Ifoobar^J$>.
When interrupting this loop, ctx->expectstring.insert_len might end up > 0.
This breaks an optimization that avoids undo tokens for insert_len since it
is usually reset to 0 after every keypress.
Once you rubout everything and retype `I`, you can crash SciTECO.
* I am not sure if this solution is ideal.
An alternative might be adding teco_state_expectstring_initial(),
but we would have to chain to it from some child states that have their
own initial() callback.
Of course, we could also simply teco_undo_gsize(insert_len) at the cost
of undo tokens.
|
|
* This does not make sense for most SciTECO builds, but only when you
want to optimize for size as the lexers take up 50% of the compressed binary
size.
Without Lexilla, it should be possible get it compiled in about 500kb.
* It can be useful for instance when building for embedded distributions.
* When Lexilla is disabled, symbols-scilexer.c is also not generated
(we assume that the Lexilla sources are not available and it also doesn't serve any purpose).
* Consequently, most of the lexer configuration scripts are also not installed
under --without-lexilla.
|
|
* This would sometimes rub out more than expected due to
reading undefined memory.
Actually even crashes were not impossible.
* This is because SCI_GETWORDCHARS does not null-terminate the buffer
it writes but this was assumed.
In effect, we could easily read beyond the allocated memory in wchars
if there doesn't happen to be a null-char following the buffer.
* Consequently, null-chars in word chars were also not supported,
although this would hardly trouble anybody.
* Instead, we now store the word chars in a teco_string_t which
supports non-null-terminated strings natively.
Still we null-terminate the string to keep teco_string_t's promises
about degrading to null-terminated char *.
This is currently not necessary.
* teco_is_wordchar() has been replaced by teco_string_contains().
|
|
* We no longer need special NULL-values for teco_cmdline_insert(),
as teco_cmdline_rubin() will simply take a character from the rubbed-out
command line and is equivalent to typing a character from the rubbed-out
command-line.
|
|
* The rubbed out command line should not be discarded.
* This has been broken since 432ad24e382681f1c13b07e8486e91063dd96e2e
(C conversion).
|
|
|
|
* Courier has the quirk that letter sequences like "fi" are turned into ligatures
which breaks the monospaced nature of the display.
* We assume that "Monospace" is also more portable, although it hasn't yet been tested on Windows.
* only relevant for the Gtk UI of course
* It might be a good idea to set SCI_STYLESETCHECKMONOSPACED as well (FIXME?)
|
|
* fixes test cases like 3<%a:>
* you can now use :F< in pass-through loops as well
* F> outside of loops will now exit the current macro level.
This is analogous to what TECO-11 did.
In interactive mode, F> is currently also equivalent to $$
(terminates command line).
|
|
registers
* An empty but valid teco_string_t can contain NULL pointers.
More precisely, a state's done_cb() can be invoked with such empty strings
in case of empty string arguments.
Also a registers get_string() can return the NULL pointer
for existing registers with uninitialized string parts.
* In all of these cases, the language should treat "uninitialized" strings
exactly like empty strings.
* Not doing so, resulted in a number of vulnerabilities.
* EN$$ crashed if "_" was uninitialized
* The ^E@q and ^ENq string building constructs would crash for existing but
uninitialized registers q.
* ?$ would crash
* ESSETILEXER$$ would crash
* This is now fixed.
Test cases have been added.
* I cannot guarantee that I have found all such cases.
Generally, it might be wise to change our definitions and make sure that
every teco_string_t must have an associated heap object to be valid.
All functions returning pointer+length pairs should consequently also never
return NULL pointers.
|
|
* allows us to get rid of some workarounds
* the workarounds themselves required relatively recent PDCursesMod
versions, so we can just as well bump the version yet another time.
We are probably the only ones building it (via Github actions) anyway.
* With v4.3.4 you should be able to link dynamically, but we are still
linking statically for nightly builds to keep binary sizes small.
Unfortunately, the glib builds shipping with MinGW still have
dynamically linked helper executables.
|
|
begin with an equals character
* Has been observed on Windows Server 2008 with Glib 2.74.1-1, but not on the
Github CI runner.
|
|
g_listenv()
* This is assumed to fix current Windows CI build problems caused by g_getenv() returning NULL
for keys contained in g_listenv(), which is probably a new Glib bug.
* Using g_get_environ() is more efficient since we do not have to repeatedly search
through the environment array with g_getenv().
* Windows 2000 - which supposedly relied on the old code because of its own bugs - is
no longer supported by our minimum Glib version anyway.
|
|
workaround
* The keyboard hook required polling as well and was actually much less performant
than the generic getch() polling fallback.
Furthemore it did at least not work on Wine.
* We instead now release the WinGUI-internal mutex and yield the thread giving
it some time to process new key presses.
* This workaround is temporary and will probably be part of the the next PDCursesMod-release
(v4.3.4). We still want to support the latest MSYS/MinGW version though which is
currently at v4.3.2.
The fix will also currently only work when statically linking in libpdcurses_wingui.a.
This is what we do for nightly builds.
See also https://github.com/Bill-Gray/PDCursesMod/issues/197
* Once the fix is released upstream and into MSYS, we should probably bump our
minimal required PDCursesMod version.
The color-table workaround (cf9ffc0cec0d2e55930238d1752209bca659c96d) can then also be removed.
* We should also consider dropping official support for the classic PDCurses and support
only PDCursesMod - this will allow us to simplify interfaces-curses/interface.c a bit.
Support for classic PDCurses is probably broken by now anyway and trying to support it
is just too much.
|
|
|
|
|
|
* avoid emitting SCI_UNDO undo tokens if the Scintilla undo action would actually be empty
|
|
* PDCursesMod is now the recommended PDCurses variant
* you should use at least v4.3.2 since earlier versions have problems
inserting CTRL+C and CTRL+V.
* We now check for PDC_get_version() since initscr() was name-mangled at least
for some time. The maintainers have now reverted to name-mangling endwin(),
we still check for PDC_get_version() as it is probably safer in the future.
* Properly define PDC_FORCE_UTF8 now.
* We no longer have to check for PDC_set_resize_limits() since PDCursesMod
now defines its own macro __PDCURSESMOD__ in curses.h.
|
|
* This is already fixed upstream, but we still include the workaround, so we can
build with the current MSYS package and during CI.
|
|
* Due to regressions, the Control handler needs to be installed later
(PDCursesMod installs its own control handler).
* We no longer have to manually set the control mode - at least on PDCursesMod/WinCON.
It's not worth keeping the workaround for the original PDCurses.
* For WinGUI neither the control handler, nor the polling-fallback will work,
therefore we introduced yet another version based on keyboard hooks.
See https://github.com/Bill-Gray/PDCursesMod/issues/197
This version may even become the default on all Win32-ports but I
need to think this through more thorougly.
|
|
* this is a regression in Gtk+ 3
* nowadays, Alt-Gr-keycombos are sometimes reported as Ctrl+Alt
which resulted in control characters to be inserted
|
|
* the same is done in the Curses UI
* important for platforms that require busy polling of memory usage (Win32)
|
|
* Using ungetch() was of course broken and could easily result in hangs as wgetch()
would never return ERR.
* This wastes some bytes on platforms that do not need the
teco_interface_is_interrupted() fallback.
* introduced teco_interface_blocking_getch()
* FIXME: This is still way too slow on PDCurses/GUI on Windows but
this can potentially be fixed upstream.
|
|
to detect interactive/batch mode
* Adds support for CTRL+C interruptions on Curses variants like PDCurses/GUI and XCurses.
This also affects the current Win32 nightly builds which should now support CTRL+C interruptions.
* The fallback is of course less efficient than the existing platform optimizations (existing for
UNIX and Win32 console builds) and slows down parsing in interactive mode.
* Use teco_interface.cmdline_window consistently to detect interactive mode.
This may theoretically speed up SciTECO code execution slightly on shutdown.
|
|
* The C standard actually forbids this (undefined behaviour) even though
it seems intuitive that something like `memcpy(foo, NULL, 0)` does no harm.
* It turned out, there were actual real bugs related to this.
If memchr() was called with a variable that can be NULL,
the compiler could assume that the variable is actually always non-NULL
(since glibc declares memchr() with nonnull), consequently eliminating
checks for NULL afterwards.
The same could theoretically happen with memcpy().
This manifested itself in the empty search crashing when building with -O3.
Test case:
sciteco -e '@S//'
* Consequently, the nightly builds (at least for Ubuntu) also had this bug.
* In some cases, the passed in pointers are passed down from the caller but
should not be NULL, so I added runtime assertions to guard against it.
|
|
decrease the binary size significantly
* -rdynamic was added to make sure that malloc replacement functions were exported and visible to shared libraries.
It was more or less currently only used on Linux and Haiku as Win32 and Mac OS do not override malloc.
* The option however exported all symbols which would prevent them to be removed at link-time.
Other optimizations could also be affected, perhaps resulting in less inlining.
* On Haiku, -rdynamic is not supported and cause build failures.
* It has been tested (nm -D ./sciteco | grep ' T ') that malloc() and friends are exported even when linking with -O3.
Even the __attribute__((used)) has been shown to be superfluous, but we keep it anyway just to be sure.
|
|
* Only x86_64 builds are supported for the time being.
They have been tested on Mac OS 10.15 (Darling) and 11 (thanks to @dertuxmalwieder).
* Curses glitches remain on Mac OS as reported by @dertuxmalwieder.
Under Darling with a Linux terminal emulator, everything looks as it should.
* We don't build AppBundles or pkg installers but instead came up with a rather
ideosyncratic way of packaging:
The packages are tarballs of the installation tree with all dependant libraries
added under /usr/local/lib/sciteco - thanks to dylibbundler.
The archives are supposed to be unpacked into the UNIX tree root (`tar -C / -xf sciteco.tar`)
and it will be necessary to "de-quarantine" all the binaries.
Details will be documented in the wiki:
https://github.com/rhaberkorn/sciteco/wiki/Mac-OS-Support
* Perhaps we will also ship an installation script (TODO).
* AppBundles would have the disadvantage that they cannot be directly installed
into $PATH. On the other hand, this would be relatively easy to do afterwards.
An AppBundle would need certain code adaptions for Mac OS, though.
* Gtk+ builds are not yet supported as I cannot test them with "Darling".
* All Nightly Build artifact names now mention the target architecture.
* build Win32 nightly builds with windows-2019
* May improve compatibility slightly in the future as we should
always build our binaries on the oldest possible system.
* Does not change anything currently since windows-2019 == windows-latest.
* CI still uses windows-latest and may therefore one day switch to windows-2022.
* updated README
|
|
* This has been broken since the C conversion (432ad24e382681f1c13b07e8486e91063dd96e2e).
* Fixes getopt.tes, although no script actually checked the contents of
the getopt.X numeric Q-Registers.
grosciteco.tes also made use of this. It's unclear what has consequently been broken.
* NOTE: TECOC does not seem to support -Uq - this is a SciTECO extension.
|
|
* This has always been broken as Gtk will not hide the
window before suspending.
* It has been deemed to complicated to implement at the moment.
Even if we can catch SIGTSTP (not that trivial), it seems to be
impossible - at least without some lower level Xlib interaction -
to hide the program window before raising SIGTSTP.
* Even if everything worked, it is unclear whether it is actually
desirable to suspend a GUI application - ^Z may be pressed accidentally
and it will be inconvenient to resume the job.
So we would additionally have to check for the existence of
an attached console.
|
|
* Keeping a key pressed could still result in missing graphics updates and thus
visual feedback.
* Now try to process all Gdk events after thawing the window.
It no longer appears to happen.
* On the downside, key processing is much slower now which may result
in keys being queued up and processed some time even after releasing it.
There may be workarounds for that as well...
|
|
* Due to introducing another gtk_main_iteration_do(),
there could indeed be unforseen recursions of teco_interface_key_pressed_cb()
that resulted in additional teco_interface_handle_key_press() calls.
* This did not cause crashes, but we better prevent recursions altogether.
While emptying the key event queue, we only allow other events to be queued
by all possibly recursive invocations of teco_interface_key_pressed_cb().
|
|
* This was surprisingly easy to implement as Gtk+ 3 already
supports it via GtkPlug.
* Allows embedding SciTECO into other Xembed-aware applications.
* Unfortunately there are very few generic Xembed hosts.
tabbed (https://tools.suckless.org/tabbed/) would be one of them.
It could be used to add tabs to SciTECO even on non-tiling window managers:
$ tabbed sciteco --xembed
* Unfortunately, it does not seem to be possible to use this feature
to let SciTECO replace the contents of a terminal window even though
many terminal emulators provide $WINDOWID.
|
|
* Processing a queued list of key events with an idle timer turned out
to be tricky.
Since teco_interface_pop_key_idle_cb() would eventually drive the main
loop with gtk_main_iteration_do() which may result in a recursive
invocation of teco_interface_pop_key_idle_cb() which will eventually crash.
* We'd have to mask the idle watcher during the execution time of teco_interface_pop_key_idle_cb().
* Therefore it has been decided to use a tight loop again to process the
event queue.
After thawing the window, we now manually drive the event loop with gtk_main_iteration_do()
to make sure that the UI is updated.
This could result in a recursive invocation of teco_interface_key_pressed_cb() of course but
the callback is already secured against this.
|
|
* NOTE: Selections are currently only used to highlight search results.
* The default selection colors were not always visible well with default settings (--no-profile)
and they were not uniform across platforms.
On Curses, the selection would be reversed, while on Gtk it had a lighter foreground color.
They are now always reversed (black on white background).
The default styles do not assume any color support - they use only black and white.
* Since these defaults cannot possibly work on every color scheme,
color.selfore and color.selback has been added to color.tes.
All existing color schemes have been updated to configure selections as reversed
to the default colors.
This especially fixes selection colors on Gtk.
* On solarized.tes, the caret style was already distinct from inversed default colors.
On terminal.tes, the color of the caret is now bright white, so it stands out
from the selection colors.
* In Curses, the caret color is currently __not__ applied to the command line where
it is continued to be drawn reversed.
The command line drawing code is considered deprecated and will eventually be replaced
with a Scintilla minibuffer.
* In Gtk, we now apply the caret style to the commandline view as well.
* Fixed the comment color in solarized.light.
|
|
* The old implementation could apparently result in use-after-free
situations that are not related to unstopped watchers in Scintilla.
This would result in frequent crashes.
Possibly, this only now manifests after upgrading to Scintilla 5.
* The old implementation also had the bug that freeing views
(e.g. via <EF>) would not release any memory in batch mode since the
main loop is not triggered.
* I don't pretend to understand why we need gtk_widget_destroy()
instead of g_object_unref().
|