aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2023-04-13cmdline.c: fixed rubbing out words (^W) and possible chrashesRobin Haberkorn2-21/+10
* 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().
2023-04-13cmdline.c: simplified the rubin-caseRobin Haberkorn2-13/+6
* 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.
2023-04-13fixed typing in characters of the rubbed-out command-lineRobin Haberkorn1-11/+12
* The rubbed out command line should not be discarded. * This has been broken since 432ad24e382681f1c13b07e8486e91063dd96e2e (C conversion).
2023-04-05fixed nightly Debian/Ubuntu buildsRobin Haberkorn1-1/+1
* Disabled pyTooling/Actions/releaser composite on Ubuntu and use a container instead. The composite step is obviously broken on Ubuntu 20.04.
2023-04-05Nightly Builds: hopefully fixed the Ubuntu buildsRobin Haberkorn1-4/+4
* pyTooling/Actions/releaser/composite updated to v0.4.6
2023-04-05updated copyright to 2023Robin Haberkorn63-63/+63
2023-04-05updated TODORobin Haberkorn1-4/+73
2023-04-05fixed formatting of dates in manpagesRobin Haberkorn1-1/+1
* The last digit of the year was cut off. This was an artifact from the time that <EG> was used for inserting the date as it was inserting a new line character as well. This is no longer necessary as GNU Make is now executing the `date` tool.
2023-04-05Troff documents: fixed monospaced example blocksRobin Haberkorn3-15/+15
* .SCITECO_TT should be before .EX, so that the indent is already monospaced. .SCITECO_TT_END still needs to be before .EE however, so that the next non-monospaced line is not "typeset" with a monospaced indent. * naturally only affects the Gtk UI
2023-04-05default font is now "Monospace" instead of CourierRobin Haberkorn2-3/+3
* 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?)
2023-04-05sciteco.tmac: also set the LL register (refs #11)Robin Haberkorn1-1/+5
* Hopefully disables paragraph breaking in newer Groff versions, but needs to be tested.
2023-04-05fixed grosciteco for newer Groff versions (refs #11)Robin Haberkorn1-0/+1
* The intermediate output of Groff will contain `t` commands before the font 1 is defined which we interpret as the default font. We therefore hardcode the default-font position to 1 by default - it won't change anyway.
2022-12-10fixed pass-through loops: especially :> and :F<Robin Haberkorn3-20/+80
* 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).
2022-12-03fixup: bundle Gtk+ Win32 pixbuf loader DLLs into the package rootRobin Haberkorn1-6/+4
* mingw-bundledlls apparently does not output MinGW-friendly filenames, so we cannot use it to bundle files into a directory differing from the executable's directory.
2022-12-03nightly builds Win32 GtkRobin Haberkorn1-2/+2
* make sure that all DLLs are packaged into the root directory even those for the pixbuf loaders
2022-12-03mingw-bundledlls: blacklisted dwrite.dllRobin Haberkorn1-1/+1
* These are apparently "Microsoft DirectX Typography Services" * patch should be contributed upstream
2022-12-03simplified win32 packaging using mingw-bundedllsRobin Haberkorn4-19/+171
* mingw-bundledlls finds and copies transitive DLL dependencies. * Like all external one-file sources, mingw-bundledlls has been copied into contrib/ instead of adding a submodule. It's taken from here: https://github.com/mpreisler/mingw-bundledlls * Packaging is more robust now if dependant DLLs are upgraded or if we decide to link in more statically. With the old scheme, we might also miss some DLL and break builds without even noticing it.
2022-12-01testsuite: added (known bug) testcases for dangling else- and end-if statementsRobin Haberkorn1-0/+6
* This is not easy to fix (show errors when encountering these constructs without preceding if <"> statements) and would require complicating the parser only to detect this. On the other hand, keeping things as they are does not really harm anybody.
2022-12-01sciteco(1) manpage: All UIs support ^C interruptions nowRobin Haberkorn1-2/+1
2022-12-01nightly builds: create Mac OS *.pkg packagesRobin Haberkorn1-2/+7
This is slightly less idiosyncratic than shipping a tarball of the installation root. The pkg has been reported to be installable even via the graphic installer when providing a password. Or it can be installed via terminal with `sudo installer`. So it no longer requires any manual dequarantining.
2022-11-28fixed a number of crashes due to empty string arguments or uninitialized ↵Robin Haberkorn10-7/+34
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.
2022-11-27Nightly Builds are uploaded as a Github release now instead of artefactsRobin Haberkorn2-68/+72
* replace actions/upload-artifact with pyTooling/Actions/releaser * The release URL will never change: https://github.com/rhaberkorn/sciteco/releases/tag/nightly * On the downside there is now a "nightly" tag in the repo that will be updated to HEAD whenever a nightly build runs - but other than that it does no harm. * Compared with artifacts, the new method has several advantages: * No more nightly.link Github App required * We can add arbitrary files into releases and no longer have to ZIP everything. So you can now download the Debian packages separately, the Mac OS "package" is a tar.gz (instead of zipped tar). For the Windows packages not much changes, though. * Files get updated in the "Nightly Builds" release even when individual jobs in the nightly.yml workflow fail. With artefacts, the entire workflow must be successful. * Releases are not deleted after 90 days as opposed to artefacts. So when my workflow breaks next time, there will still be files to download for a long time. * As a downside, the file names in the release have to be uniform and must not contain versions, commit hashes and dates so that uploads replace old files instead of adding new ones. Some manual cleanup could still be necessary after large packaging changes. This could be worked around, by uploading everything first as artefacts and updating the release in a separate job, but is not worth the trouble IMHO. * Another disadvantage is that there will be no old nightly builds to download (although these were not easily downloadable for end users before).
2022-11-27added Markdown and YAML lexer configsRobin Haberkorn3-1/+53
* For markdown.tes we should better introduce new predefined colors in the color scheme files since it doesn't map well to existing colors. For italic and bold, I am not using the predefined colors at all but only set the bold and italic style attributes -- this should still be portable across color schemes.
2022-11-22scite2co.lua: avoid unnecessary string concatenations with io.write()Robin Haberkorn1-9/+9
Not that speed would make any difference here whatsoever...
2022-11-22scite2co.lua: support generating substylesRobin Haberkorn1-19/+48
2022-11-21improved the C/C++ and Gob lexersRobin Haberkorn4-4/+13
* single quoted constants are highlighted like single quoted strings in all other auto-generated lexers using "CPP". * recognize /// and //! and comments after preprocessor statements
2022-11-21added lexers for Python and Linux Device TreesRobin Haberkorn3-1/+96
* The device tree lexer reuses CPP and has certain limitations. For once it does not recognize /keywords/ and secondly it confuses properties beginning with # as preprocessor statements.
2022-11-20fixed nightly builds on Win32/Gtk: the libffi DLL name has changedRobin Haberkorn1-1/+1
* should fix Win32/Gtk packaging
2022-11-20fixed nightly builds on Win32: the PCRE DLL name has changedRobin Haberkorn1-2/+2
* Gtk packaging is quite possibly still broken
2022-11-20bumped required PDCursesMod version to v4.3.4 or laterRobin Haberkorn3-26/+3
* 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.
2022-11-20test suite: temporarily disabled the "Pattern matching overflow" test caseRobin Haberkorn1-7/+9
* This test case no longer fails on MacOS and MinGW builds probably because the settings of the underlying libpcre library changed. * Since these settings are not predictable, cannot be queried and may even change on some flavors of Linux, it has been completely disabled for the time being. * Should fix CI and nightly builds on MacOS and Win32
2022-11-20fixed teco_qreg_table_set_environ() on Win32: sometimes keys unexpectedly ↵Robin Haberkorn1-1/+13
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.
2022-11-20Github workflows: no longer try to build on deprecated runners like ↵Robin Haberkorn2-3/+3
ubuntu-18.04 and macos-10.15 As much as I like to support older systems, this will otherwise suddenly and unexpectedly break CI and nightly builds in the near future...
2022-11-20teco_qreg_table_set_environ() will now use g_get_environ() instead of ↵Robin Haberkorn1-9/+5
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.
2022-11-20added .gitattributes to disable automatic EOL transformations by GitRobin Haberkorn1-0/+4
* These caused problems on Windows where it would check out Groff *.tmac files with CRLF linefeeds, causing lots of bogus warnings in the CI build logs. * Who knows what kinds of problems this could cause with SciTECO macros (*.tes). * In general, there is no reason not to use exactly the linefeeds committed into the repository, so most files should be checked out with LF even on Windows. It may be necessary to use CRLF on Windows-only files, but even sciteco.rc currently works with Unix linebreaks.
2022-06-22PDCursesMod/WinGUI now uses the polling fallback again with a temporary ↵Robin Haberkorn2-76/+21
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.
2022-06-21fixed win32-curses CI builds: build-wingui/contrib and build-wincon/contrib ↵Robin Haberkorn1-1/+1
were missing
2022-06-21updated copyright to 2022 and updated TODORobin Haberkorn64-63/+68
2022-06-21avoid unnecessary creation of undo tokensRobin Haberkorn2-5/+8
2022-06-21fixed rubout of certain constructs like Ifoo$FRX$$Robin Haberkorn3-4/+17
* avoid emitting SCI_UNDO undo tokens if the Scintilla undo action would actually be empty
2022-06-21Nightly builds: the PDCurses package will now contain both WinCON ↵Robin Haberkorn1-7/+20
(sciteco.exe) and WinGUI (gsciteco.exe) binaries * newer versions of PDCurses on MinGW contain both WinCON and WinGUI (static) libraries
2022-06-21better support recent versions of PDCursesMod (used to be the Win32a-port)Robin Haberkorn3-10/+14
* 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.
2022-06-21PDCursesMod: fixed the light black color on all GUI backends (e.g. WinGUI)Robin Haberkorn1-0/+4
* This is already fixed upstream, but we still include the workaround, so we can build with the current MSYS package and during CI.
2022-06-21PDCurses: fixed CTRL+C interruptions on WinCON and WinGUIRobin Haberkorn1-28/+87
* 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.
2022-06-21Gtk+: fixed interpretation of Alt-Gr-keypressesRobin Haberkorn1-1/+6
* 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
2022-06-21Gtk+: Stop memory limiting when idlingRobin Haberkorn1-0/+8
* the same is done in the Curses UI * important for platforms that require busy polling of memory usage (Win32)
2022-01-15fixed CI builds on WindowsRobin Haberkorn2-3/+3
* Autotools are apparently no longer preinstalled or part of base-devel.
2022-01-15fixup: use a dedicated input queue data structures (teco_interface.input_queue)Robin Haberkorn1-22/+35
* 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.
2021-12-22Curses: added teco_interface_is_interrupted() fallback and standardized how ↵Robin Haberkorn2-10/+58
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.
2021-12-19safer use of memcpy() and memchr(): we must not pass in NULL pointersRobin Haberkorn6-6/+23
* 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.